For me I just usually wait until I fall out of love with it. When I dont feel like driving it anymore or I just get bored of it. I only buy cars that I enjoy owning but when I dont enjoy it anymore thats a pretty clear sign for me to move on and get something new.
6 months before the warranty expires, or no longer than 80k miles. If you wait any longer, you kill your trade in value. Besides 4-5 years ,and 80k later, technology should have come up with the new bigger better, higher mpg car by then. Every 3-5 years, large improvements are made in the automotive world. So by the time new tech comes in, you should be ready for a new car to stay ahead of the curve, in my opinion.
I have a 2001 with over 324,000 km on it. At this point, there's no sense in selling it. Its made more memories and travelled more km in a shorter period of time than any other vehicle I've owned, because I'm not scared to take it on dirt roads and go exploring with it. It'll be in my possession until it completely falls apart and can't be driven anymore.