As mechanics, people always ask us when they should get rid of their current car, and buy a new one.
There are many technical ways to determine whether or not you need a new car, but there is also one very simple way.
Buy a new car when ... you can afford to buy a new car!
Many people are sentimental and they hold in to their cars for as long as they can because they have some sentimental value attached to them. If you are so attached to your car that you can't imagine giving it up, then by all means, keep repairing it.
But, the best advice I can give you is simply to do the math. If the amount of money you are spending on your car to keep it running is starting to equal what you would spend to buy a newer one (don't forget to factor in the amount of money you will gain by selling the old one!), then I would say it's about time to get a new car.