I'm guessing that you are referring to electrolytic capacitors, and I'm also guessing that what has prompted this question is the case of industrial espionage years ago that resulted in flooding the market with electrolytic capacitors that were defective. These capacitors failed on a regular basis prompting the computer industry to start looking for bad caps after the first sign of trouble. That era has pretty much passed, but caps do still fail. You can recognize bad caps by inspecting them,
electrolytic capacitors should have a flat top, caps that have failed or are failing can exhibit a rounded top or leaking fluid at their base.
As for the life expectancy of a electrolytic capacitor, the easy answer is years. But there are factors that will effect that range, the excerpt below is from this article
which explains how they breakdown.
Why do capacitors fail?
Electrolytic capacitors use a semi-liquid electrolyte inside the case to make electrical contact with the foil windings. This electrical interface is inherent in the capacitor’s ability to carry current and function as an energy storage unit for the electrical power input. When the interface between the electrolyte and the metallic foil windings begins to degrade, the electrical connection begins to fail. Heat build up is the primary cause of this degradation, which, depending on severity, can cause either short-term catastrophic failure, or long term functional degradation. Similar to the life expectancy of a silicon semiconductor die, the life expectancy of an electrolytic capacitor relates directly to its internal temperature. Every 10° C increase in internal temperature halves the component lifetime.