For me its 100% situational. Some cars you can drive forever and parts are cheap and easy to replace. I had an 87 Olds Cutlass that I put 350,000 miles on because there wasn't much that could fail. I replaced the engine once with a $200 junkyard engine. I found alternators at Auto Zone for $29, front wheel bearings were $16, and brake calipers/cylinders ranged from cheap to damn near free.
Contrast that with my wife's 99 E300TD with 207k. I'm starting to see some failures that indicate either huge labor or huge cost so I'm selling it while I can.
The cutlass also had some good engineering points that made it a bit more of a workhorse - full perimeter frame, plenty of under-hood access for any repairs, very low HP so there was very little strain on driveline parts, and the access to a bazillion used parts made it super economical to keep it running.
Something like a Cavalier or a Civic with a unibody I wouldn't go that far. Metal becomes work-hardened as it flexes and vibrates which leads to reduced stiffness, safety, and even just plain ripped welds. Of course this also varies widely. My wife's E300 is remarkably stiff and rattle free; a testament to Mercedes engineering. But a Plymouth K car was a wet noodle when you drove it off the lot.
I also look at its value - either on the market or to me. Do I want this car bad enough to spend more money than its worth? Will doing this repair be worth it when I sell it? That kind of thing.
I bought a 62 Cadillac SDV with over 580k on it. Dropped in a used 390 for $500, chopped the springs, shaved the door handles, put a horse blanket over the seats, and painted it flat black. That was both worth it to me AND the market. I sold it for way more than I had in it.
But... as I'm looking for a replacement car for my wife, I'll be looking for low mileage Scion xB. She likes to own a car until it turns into a pile of dust.