Generally, an AC and its compressor have a warranty period of 10 to 15 years. However, it can last for 20+ years with timely servicing and maintenance. The lifespan of repair depends on three things:
Which company repaired it
Which part was repaired
Serviced or not
Find a credible service company before looking for AC repair services near me. If you get your AC repaired by a reputed technician, it will last even after the guarantee period of your AC. Also, get it serviced at least once every six months.