You're usually upgrade-eligible at about 4-6 months left on contract. At this point, they'll usually offer a slightly reduced price (20-30% off retail). At around 2 months, they'll offer the fully discounted new-contract pricing.
Your best bet is to just call customer service and see when your contract expires.