There is no single number of years that applies to all batteries. Lifespan depends on the chemistry, construction, temperature, usage, and operating settings. Over time, the amount of energy it can store gradually decreases.
Charging cycles describe battery usage. One equivalent full cycle can result from several partial charges and discharges; it does not necessarily mean one connection to the charger. Aging also continues over time, even when usage is limited.
In the warranty, look for the duration in years, any limit on cycles or total energy throughput, and the minimum retained capacity under the specified conditions. Check which limit applies first and what installation or connectivity requirements apply.
A warranty for a specific number of years does not mean unchanged performance or mandatory replacement at its end. Ask for the terms for the exact model and follow the manufacturer's permitted settings.