Stars & the Milky Way Galaxy
Mass is ultimately the most-important factor in determining the type of a given star.
A star's initial mass upon formation largely dictates where it will fall on the main sequence of the H-R diagram, what luminosity it will have at different stages in its evolution, what its core and surface temperatures will be, and so on. Some other factors like the specifics of elemental composition (still dominated by hydrogen, less helium, and trace amounts of other elements), its surrounding environment (such as multi-star systems), and other factors have only minor effects on the star's characteristics compared to the mass.
A star's overall lifetime depends on how fast it burns through the core's readily-available supply of fuel (for most of a star's lifetime — its main-sequence lifetime — that will be hydrogen), though the effect of adding more mass shortens this lifetime rather than lengthens it. Since the addition of more mass increases the gravitational forces causing the star to collapse inward on itself, the core pressure and temperature would rise and burn through fuel more quickly. This causes more energy to be produced (to support against the stronger gravitational collapse), and overall causes the star to be hotter and more luminous. Therefore, higher-mass stars are larger, hotter, and more luminous than lower-mass stars of the same equivalent age, but are also shorter-lived.
The typical range of masses for stars is from about one tenth the mass of the Sun to perhaps a couple hundred solar masses (about 0.1 – 200 MSun). Too little mass and the gravitational forces collapsing the star do not create enough pressure and a high-enough core temperature to initiate main-sequence fusion (the proton-proton chain); too much mass and the energy generated by fusion tends to blow the star apart prematurely.
The degree to which additional mass shortens a star's lifetime is quite remarkable, as is the difference in luminosity. The table, below, illustrates this with some examples; note that the figures for radius, temperature, luminosity, and lifetime given are for the stars' main sequence stage — i.e., the stars all at the about same equivalent age, if not the same absolute age:
|effective surface temperature
|estimated main-sequence lifetime
You can see that the luminosity of a higher-mass star is not increased by the same factor as the mass, but by that mass raised to a power; its lifetime also drops by a much greater factor than the simple mass multiplier.
For reference, the present age of the Universe is estimated at about 13.7 billion years (13,700,000,000); the Sun and Solar System are about 4,500,000,000 years old. The lowest-mass stars may last many times those ages, while any high-mass stars currently existing must have formed very recently by comparison.
Sometimes it is said that the Sun is just an "average" star, as stars go; however, it is worth noting that low-mass stars vastly outnumber higher-mass ones. The Sun is more massive and more luminous than most nearby stars in its galaxy — in about the top 10 %.