The life of a star is determined by how large it is.
Credit: NASA, ESA, R., F. Paresce, E. Young, the WFC3 Science Oversight Committee, and the Hubble Heritage Team
Stars live different lengths of time, depending on how big they are. A star like our sun lives for about 10 billion years, while a star which weighs 20 times as much lives only 10 million years, about a thousandth as long.
Stars begin their lives as dense clouds of gas and dust. After a star forms, it burns hydrogen into helium, and once hydrogen begins to run out, further stages of burning occur, such as the burning of helium into heavier elements.
If the star is less massive than several times the mass of the sun, it will eventually become a white dwarf. If it is even more massive it will first implode and then explode in a supernova explosion.