I don't really have a rule of thumb other than to always pay cash. I guess I sort of have in mind to keep a car around 10 years or so, but I'm not beholden to that. My car history:
(1) Buy a used 1999 Mercury Cougar in 2001. Take very good care of it. Start to get expensive repairs through 2010 and 2011 -- a couple times, the bill was like $1600 or $1200 ish. A number of times the car refuses to start, those repairs are done, different problem causing refusal to start. It lost power steering, etc. as I was exiting the highway to meet a partner and a client for an important business trip, and I was a mile short of where I was supposed to meet them. That is the straw that broke the camel's back because I really let them down -- had to deal with my car instead of joining their carpool to our meeting a few hours away.
(2) Buy a new 2012 Mazda6 in December 2011. Love it, take very good care of it, absolutely nothing to fix since then -- just standard oil changes. I can't imagine not having this car for at least 5 more years. I guess one can never know, but that seems like the minimum time I would keep it.
OP, I did see your listing of repair costs in your other thread. To me, those are pretty outrageous. If I were you, I would be buying a replacement -- a couple years old, used car that is known for reliability, like a Honda or Toyota or something.