A capacitor is built to last the lifespan of the AC unit or heat pump, which is to say 15-20 years.
This is liable to fluctuate, however, depending on
The ambient temperature
The number of times the unit or heat pump receives maintenance
The frequency at which the AC system is used
How old the capacitor is to begin with
How often you experience power surges