I was a director of aircraft maintenance ina flight school. We used to sell the 172s off at around 12,000 hours, as that's where Cessna wants a bunch of NDI done on the airframe, and, typically, the upholstery and interior were shot, the engine was nearing TBO, the control cables and pulleys were worn out, stuff like that. Add it up and you can buy another 2000-hour airplane, spend the money on it instead and be ahead. However, as pointed out, there are schools running 20K hour airplanes, but I do wonder if they're paying attention to the weak spots.
The forward spar in the horizontal stab cracks out from the center hole when people push down on it to lift the nosewheel to turn the airplane on the ground. Cessna forbids that, and it's an expensive repair. I found one in an airplane bought sight unseen by some poor fellow; that spar was broken completely through and only the skin was holding stuff together. Another spot is the bottom of the aft doorposts, where the post cracks where it joins the gear box. Taxiing over rough ground, or landing in a crab, does that. It's hard to spot, but I found the posts cracked in a 2100-hour airplane we bought.
If you're going to buy an airplane, get an experienced and conscientious mechanic to do a thorough prebuy on it. Any big defects can be used to get the price down, perhaps enough to pay for the prebuy plus some margin to fix the issues.