I generally upgrade every 3 years or so, whenever the performance of the new phone blows away the old one to a great degree, or whenever some killer new feature comes along. Here's the iPhones I've had, and what got me to upgrade:
Original (2007-2010): I bought a 4GB iPhone right after their discontinuation in September, because $299 for an iPhone was finally in my college student price range. This was a wonderful phone that served me well, and still has a home in my bag as an iPod.
3GS (2010-2013): I got a 32GB 3GS right after the 4 came out. Again, pricing was a major factor. I upgraded here because the original iPhone had finally stopped receiving software updates once iOS 4 came out.
5 (2013-2016): Once again, a close out 32GB iPhone 5 was purchased after the 5S had come about. This phone was purchased as the 3GS was starting to feel a bit slow, and had come to the end of iOS updates itself.
SE (2016-20??): I purchased an SE earlier this year to replace the 5. I honestly didn't have any real performance complaints about the 5 three years on, nor was it at the end of it's iOS updates. I purchased the SE because the resale value on the 5 was still decent, and the performance delta between the two was stellar. I have a well-paid job now, and thought that I ought to reward myself a bit. Plus, I had the 3-year itch
The Original and the SE are the only two iPhones that I have purchased when they were the latest and greatest. I tend to buy when the RAM doubles, as those phones tend to last the longest with regards to updates. Most of my old iPhones are still serving me well; the original is still used as an iPod because I love the design of that phone, and the 3GS lives in the glove box of my car holding my entire library of music. The 5 was sold to fund the SE.