I keep them for ages if I like the way they ride. Get rid quick if not. I just sold a 2007 yeti 575 - more due to ill health than anything else. I preferred it over the newer 575 - so flickable and unbeatable on Cumbrian rocks up or down.
I would argue that if a bike is any good it takes years to squeeze the last few drops of speed from a new bike. I was still finding ways to get more out of it.
Next purchase will be a change of direction to a fast hardtail 29er.