What happens when my AT&T contract is up?

Well I have an iPhone 5 that I bought under a contract from AT&T. I was wondering how this upgrade thing works? Like do I have to pay for my upgrade? Do I have to repay the $150 I payed for not having that good of credit? Do I go back to AT&T or Apple? Basically how is the process into getting a new phone? And also what should happen if I wait and go past the 2 years to get a new phone?

I went in to ATT, looked at all the phones, picked one out and paid for it and the contract continued.

Starting the day after contract is up, your bill basically becomes month-to-month.
Can drop at any time you please. You're free.
Also, phone is legally now your's. Have ATT contact Apple and unlock the phone. You can now use on many other (and cheaper and monthly) networks if you prefer. You will need to go to ATT for that.
$150 is way gone--don't worry.
If/when you buy another phone from ATT you will start ANOTHER contract--probably not the one you have but insist you keep it if you can at all.
Good news is you can use the old 5 as an iMessaging iPod or actually sell it for pretty good money.
http://www.gazelle.com/

Your choice, your coins.
Shop their site for scenarios
Best luck.
http://www.att.com/...vices.html

Welcome to America, that's how business works.
https://discussions.apple.com/...5#23295485

http://gigaom.com/2013/06/10/cutting-its-costs-att-pushes-phone-upgrade-policy-out-to-24-months/

http://www.csmonitor.com/Business/Saving-Money/2013/0224/Phone-plans-101-breaking-down-the-major-carriers

http://evolver.fm/2013/09/20/how-to-upgrade-to-iphone-5s-without-losing-your-unlimited-data-plan/