A star's lifespan is primarily determined by its mass. Massive stars burn through their nuclear fuel much faster than smaller stars. For instance, a star with a mass several times that of the Sun may have a lifespan of only a few million years, whereas a smaller star, like a red dwarf, can last for tens to hundreds of billions of years.