A planetary nebula is an astronomical object that usually appears nebulous and disk-like in low-resolution observations.
Because of this appearance, similar to the appearance of planets in early observations, the "planetary" adjective was attached and has since been retained for historical consistency.
According to current observations and models, planetary nebulae in fact have little to do with planets. Instead, as a small star (less than a few times the mass of the Sun) grows older, it tends to throw off upper layers of stellar material in various episodes of fusion reactions. While the central progenitor star dwindles to a white dwarf, the thrown-off gases form a cloud of material around it. It is this cloud which is designated as a planetary nebula. The remains of the star which produced the nebula is also responsible for the energy which causes it to glow. The Sun is predicted to become a planetary nebula at least 5 billion years in the future.
Left image: an X-ray image of the Cat's Eye nebula from the Chandra X-ray Observatory, revealing a bright central star surrounded by a cloud of multimillion-degree gas. Right image: a composite image of Chandra and Hubble Space Telescope data comparing where the hotter, X-ray emitting gas appears in relation to the cooler material seen in optical wavelengths. (Chu et. al., left; NASA/HST, right; GDL-OK)