Several factors can impact the lifespan of a hamster, including breed, genetics, diet, living conditions, and overall health. Providing a healthy and stimulating environment can help to increase their longevity.