I got my license in December 1986, and I think I've had about 16-17 cars since then!
But I'm into antique cars, and usually have several around. Plus I've gotten cars handed down to me by friends and family members that no longer wanted them. Sometimes they'd still have plenty of life left in them; sometimes they'd be on their last legs.
The longest I've ever had a car was 17 years, but it's really more of a toy. It's a 1957 DeSoto Firedome that I bought back in 1990, when I was still in college. I'll probably take it to my grave with me.
I've only bought one brand-new car in my life, a 2000 Dodge Intrepid. It was mainly the low 0.9% financing that suckered me in, but it's been a pretty good car. Currently has about 130,000 miles on it, and still running strong. At this point, I figure I'll just run it until someting major goes wrong with it, like the engine or transmission. It's not worth trading at this point. I'd probably only get $2000 at best for it, and I'm just not ready to get back into a car payment yet.
So basically, I don't have a set timeframe for buying or selling cars. Usually it's when something gets wrecked or something major goes wrong. But sometimes I'll just find something I like better or is more useful. For instance, I got rid of my grandmother's old '85 Buick LeSabre when my Mom said I could have her old '85 Chevy pickup. I figured I had enough cars already, but the pickup would be better than the Buick for trips to the dump, Home Depot, etc!