Stars come in many varieties, including simmering dwarfs and brilliant hypergiants. The life expectancy and ultimate fate of a star — and, therefore, any planets orbiting it — is tied to its mass: Red dwarfs may live for trillions of years, whereas massive st…