UPDATE (06/20/13 10 AM): The Best Buy offer is back and if your phone is worth more than $150, the difference will be applied to a gift card, not a higher-end iPhone 5 model (9to5mac)
Apple devices in generally have excellent resale values, probably because the hardware does not go out of date as fast as other devices as a result of the tight integration Apple controls between its hardware and software. Lets consider the case of an iPhone for this part of the article. iPhone 4 was released in June 2010, iPhone 4S in October 2011 and iPhone 5 in September 2012. Now that we have the release dates with us, lets consider some scenarios for a normal iPhone user amongst us. To make things simple, let us consider only 16GB iPhones here and you can add a $100 to every 16GB of memory and the math still holds good. (Also this article and the prices quoted in it applies to USA only).
Say you bought an iPhone 4 in September 2010 and want to upgrade to iPhone 5 now. It has been three years since your iPhone 4 purchase and lets check how much you can get for an iPhone 4 now if you want to sell. There are a few options to choose like selling it on resale sites like Gazelle.com ($145 - $150) or Nextworth.com ($136) or Glyde.com ($186). Another option is to sell it to individuals on ebay or craigslist (be careful here and make sure you sell it locally and accept only cash). Depending on how lucky and/or patient you are, you may get a few more this way. The third option for the laziest amongst us is to keep looking out for special offers from big store retailers like Best Buy that offered an interesting promo a few weeks back. It offered $150 trade in credit towards a purchase of a new iPhone when you trade in your used iPhone 4 or 4S, of course trading in 4 for $150 is more profitable than a 4S, but since Best Buy also reduced the iPhone 5's price from $200 to $150, you eventually got a new iPhone 5 for free by trading in your old iPhone. Now you see where I am going with this.
The iPhone 4S sells for higher prices obviously as follows: Gazelle.com ($205 - $215) or Nextworth.com ($212) or Glyde.com ($269) and ebay (as high as $300). If you are a iPhone 4S owner who bought the iPhone 4S in 2011, you are most definitely out of contract now and that means you can upgrade now and if you buy a 16GB iPhone 5 now you can actually make some profit by upgrading now, come on, even the skeptics out there should be listening now! After two years of using an iPhone you will be able to upgrade to the latest iPhone and make money from the upgrade? Wow!
iPhone 5 owners' contract is midway and on a case by case the carriers sometimes allow early upgrades where a new whatever iPhone model is released (say iPhone 5S later this year) is not $200, but $400, that is a partial upgrade. But iPhone 5 sells for higher prices as follows: Gazelle.com ($300 - $330) or Nextworth.com ($340) or Glyde.com ($396) and ebay (as high as $400). So again even if you are in the middle of your contract, assuming you possess good arguing and convincing skills needed to talk to AT&T, you can upgrade to the new iPhone after one year of purchase and break even!
If you own an older iPhone like 3GS, then then you have to pay more to upgrade and hence its always better to have either the latest or one model older iPhone. This way all you spend is the $200 for your first ever iPhone and then you just keep swapping your old iPhone for the newest version for no extra cost. So for a one time $200 you will always have the latest iPhone for the rest of your life, if you time your sale properly with some research. The math above changes a little if your buying date is off a little, but overall the above argument still should apply.
A few points to note are that these prices reduce drastically right after a new iPhone launches and hence it is wise to sell your old iPhone a few days before the new one arrives. If you are worried about being without a phone is the mean time, sites like Gazelle offer a 30 day price lock guarantee where once you get a quote for selling an old iPhone, you have 30 days from that date to actually go through with the sale for the same quoted price. For example say you are pretty positive that Apple is going to announce the new iPhone in a few days from now, head to Gazelle and lock in a price quote and you can send it to them for selling it after you buy the new iPhone and still get the same selling price.
Also the price these places are going to offer for your iPhone might greatly differ based on the condition of your old iPhone (like the scratches it has on it, on whether you possess the charger, cables, etc). In summary unless you are lazy or extremely attached to an iPhone model, there is no sense in not upgrading to the latest and greatest iPhone for free or for that matter any new phone, though other phones cannot give you this good a resale price. For example Samsung Galaxy S3 released in May 2012, sells for $145 - $165 on Gazelle.com compared to the one year old iPhone 5 (Sep 2012) that sells for $300 to $330 or the two year old iPhone 4S that sells for $205 to $215. The numbers talk for themselves here, don't they!