How long do you have to have an Att phone before you can upgrade?

you usually have to have it for 2 years to get an upgrade but you can always just go buy the upgrade for at&t but if you want it free you have to wait two years