Since planetary stars (stars with planets) are essentially the same as other stars, they die the same way. All stars die when they run out of sufficient hydrogen in their cores, and the manner of their death is determined by their size. Essentially, the larger the star, the more dramatic its death.
The smallest stars, red dwarf stars, are less than one-half the mass of our own Sun, and sometimes even less than 1% the mass of the Sun. Most stars in our galaxy are red dwarfs, although because many of them are so small, we likely lack the means to detect many of the very distant ones. Because they are so small, the pressure inside red dwarf stars is strong enough only to fuse hydrogen into helium very slowly, meaning that these stars may have lifetimes lasting into the trillions of years. They can still host planets, however – Gliese 581, whose planets have made headlines several times for being roughly Earth-like, is a red dwarf star. Red dwarfs are so small, however, that we believe when they run out of hydrogen, they simply grow dimmer and dimmer, eventually winking out like a burnt-out light.
Dying with a whimper rather than a bang is not something one expects from larger stars, however. Yellow, G-type stars like our own Sun, which have a life expectancy in the billions of years, are probably also home to numerous planets, although it is easier to find planets around red dwarf stars. (Planets are easiest to detect when they are very close to their star, and red dwarf stars’ dimmer light and weaker gravity means we can search for Earth-like planets within the equivalent of the orbit of Mercury in our own solar system.) It is with these stars that star death starts to become much more interesting – and much more violent.
Our own Sun is about halfway through its expected lifetime of ten billion years. Towards the end of that lifetime, as the hydrogen in the core is depleted, it will expand into a red giant. A red giant is cooler overall, but far larger, because fusion reactions are now occurring throughout the star. Red giants are massive – the surface of the Sun will expand outwards potentially as far as Earth’s orbit, swallowing us in the process. (We won’t notice – in about one billion years, the gradually heating Sun will become hot enough to evaporate the oceans, leaving Earth resembling Venus today and forcing our descendants, if they still survive, to migrate outwards at least as far as Mars.) The sun’s red giant phase will be quite brief (just a few million years), after which it will collapse inward again. The outer layers will be released into space, forming a nebula, while the remnant of the core will become a glowing ember known as a white dwarf.
Much larger stars die even more violently. Blue giant stars are many times the size of the Sun, and burn through their hydrogen so quickly that many have life expectancies of just a few million years. These stars can explode into violent supernovae as their outer layers are shed off into space. Their cores are so massive that instead of simply remaining as glowing embers, their gravity forces them to collapse further. Some form neutron stars – stars so massive that gravity has overridden the electromagnetic forces that hold atomic nuclei apart, collapsing the star into a region just a few miles across. The even larger ones can form black holes – tiny regions of space so dense that even light cannot escape their gravity (hence the name “black” hole).
None of these stars will be kind to their planets as they die. The planets around low-mass stars will survive, but without any more life-giving light, they will become dark, cold husks floating around the dead remnants of their stars. The massive explosions with which larger stars die are expected to completely obliterate whatever remains of their planetary systems.