It may come as a surprise that the longevity of your air-conditioner lies in your hands. Yes I know if the installation or any repair has not been done the right way, that could have an adverse effect on the lifespan of your unit.
But if the abovementioned is done correctly, the ball is in your court. It all depends on how often you do regular maintenance of your air-conditioner. An air-conditioner that is serviced on a monthly or a bi-monthly schedule could see you enjoying your air-conditioner for many years. There are units out there that have been running for 20 to 30 years.
There are other factors that could have a negative influence on the lifespan of your air-conditioner like power spikes or electrical spare parts that might pack up. But now you say “how do I know if any repair or installation has been done correctly? How would I know if this repair affects the lifespan of my unit? I am not an air-conditioning technician.” By using reputable and trusted air-conditioning specialists insures that quality repairs and services are carried out. Doing some homework and research, and obtaining contactable references is a good way to find loyal and dependable companies that could help you with all your Air-conditioning needs. So to end off, I will say your air-conditioner can provide you with years and years of comfort: it all depends on how you look after you units, and who looks after your units.