The average life expectancy of hamsters is approximately between 2 and 3 years. Specifically, the lifespan of different hamster breeds varies:

Dwarf Winter White Russian Hamsters (Campbell's Dwarf Hamsters): The average lifespan is around 2 to 3 years.
Roborovski Dwarf Hamsters: They have a slightly longer lifespan, usually around 3 to 3.5 years.
Syrian Hamsters (also known as Golden Hamsters): Their lifespan is also between 2 and 3 years, but some can live for more than 3 years.
The main factors that affect the lifespan of hamsters include:
Breed: There is a significant difference in lifespan among different hamster breeds. Some breeds, like Roborovski Dwarf Hamsters, have a longer lifespan, while others, such as Dwarf Winter White Russian Hamsters, have a relatively shorter lifespan.
Gender: Generally, male hamsters tend to live slightly longer than female hamsters because female hamsters endure greater physiological stress during the childbearing process.
Raising Environment: A clean, dry, and well-ventilated living environment has a significant impact on the health and lifespan of hamsters. Poor environmental conditions can lead to various health problems, thus shortening their lifespan.
Diet: A balanced diet is crucial for the health of hamsters. Providing specialized hamster food, fresh vegetables, and protein-rich foods can extend their lifespan.
Living Habits: Disrupting the hamster's biological clock and providing substandard toys, chew sticks, etc., will all affect its health and lifespan.
By providing a good raising environment, a balanced diet, and careful care, we can extend the lifespan of hamsters and improve their quality of life.