Most often, I tend to upgrade when it makes financial sense, or when my old computer is no longer cutting it. Whichever happens first.
I went 2007 MBP > 2009 MB > 2011 MBA > 2013 rMBP.
...and Power Mac G4 > iMac G5 > 2011 iMac
The MBP was my main computer till 2012 when I replaced it with a 2011 MBA. (MB was a school-issued laptop only). After five years, it was not only slow - but it was pretty much worthless on the second hand market. When I bought the MBA I sold it after only two years, as I got only about $200 less than what I paid for it. I also got a great deal on the 2013 rMBP, so the upgrade worked out very well.
Also, I never put any money into upgrading old computers, I much rather use it and put up with it until I replace it completely.