There is no single age or repair price that answers the question
The repair-versus-replacement decision should consider the condition of the entire cooling system, not only the failed component. Equipment age matters, but so do repair history, refrigerant type, indoor equipment condition, airflow, comfort and the expected cost of keeping the system operating.
A relatively inexpensive repair on an otherwise sound system may be reasonable. A major repair on aging equipment with other known problems may justify evaluating replacement.
The goal is to compare the likely value of the repair with the cost and benefits of a properly selected replacement system.