The $5,000 rule
Multiply the age of the system in years by the repair cost. If the result is over roughly $5,000, replacement is usually the better financial decision. A 14-year-old system with a $500 repair scores 7,000 — replace. A 6-year-old system with a $500 repair scores 3,000 — repair.
Things that tip toward replacement
R-22 refrigerant (phased out and expensive), a failed compressor, repeated repairs in consecutive seasons, or rooms that have never cooled evenly because the system was sized wrong.
Things that tip toward repair
Capacitors, contactors, fan motors, and thermostats are inexpensive, fast fixes on an otherwise healthy system. Ask the technician to show you the failed part and its reading.