There are different types of generators out in the market. For example, a typical standby generator lasts differently from a portable generator.
The life expectancy of a stationary fuel-powered generator is about 3000 hours or 30 years if used in the right way. Also, the life expectancy of a portable generator is around 15-20 years or 1500-2000 hours.
It also depends on the number of hours the generator is used. The above calculation has been made because the generator is used for 100 hours in a year.