The stellar lifespan is the duration over which a star exists, from its formation in a molecular cloud to its ultimate demise, determined largely by its initial mass. Massive stars burn through their nuclear fuel quickly and have short lifespans, while smaller stars, like red dwarfs, can last for billions of years.