I think the answer you're looking for is very vehicle dependent, and not just make/model. It's how is your specific vehicle holding up? If a repair costs $3,000 and will gain you a few more years of life, that's going to be a lot less expensive than a car payment. A $600/mo payment is 5 months to break even for that repair. Plus, your ability to repair yourself vs paying a shop is going to make a huge difference. So, once things start snowballing into one repair after another, that's probably the sweet spot, but the trick is to sell it before then, which requires a crystal ball.
I had a 20 year old Regal that had ongoing issues every few years, but it was an extra vehicle with only liability insurance. So, when a window regulator would fail, for $50 and I repair it myself, that's cheap cost of ownership. The same for wheel hubs, water pump, fuel level sending unit, etc. Now, for someone to pay a shop, it may or may not be worth it once you add in cost of lost work time and possibly a rental car, plus overall aggravation of not knowing what to do or how to fix it.
I worked with a guy that had identical Audi A6's for he and his wife. One never needed anything but regular maintenance. The other was in the shop for expensive repairs every 6-9 months with one thing after another, but he loved those twin supercharged A6's. Very vehicle dependent. He eventually ended up keeping the good one and sold the other.