Ultimately this question is best answered by a qualified contractor, but there are some general rules that can help guide your conversation. Depending on the age, how often your system runs and where you live you could be better off replacing rather than repairing it. If the problem is something simple and inexpensive like a failed part you are much better off repairing it. However, if a contractor tells you there is a refrigerant leak or the compressor needs to be replaced you should weigh the cost-benefit options of replacing the whole system versus paying for costly repairs. You will also need to consider what type of refrigerant your old system has (likely R-22) since it is being phased out in favor of a more efficient and environmentally friendly refrigerant, R410A. It could be more costly in the long term to continue servicing a system with out-of-date refrigerant.
Repair vs Replace: How to Talk to Homeowners