A comet is a small body in the solar system that orbits the Sun and (at least occasionally) exhibits a coma (or atmosphere) and/or a tail — both due primarily to the effects of solar radiation upon the comet's nucleus, which itself is a minor planet composed of rock, dust, and ices.
Comets have highly elliptical orbits; they come very close to the sun (within the orbit of Mercury), and then they go way out to the edges of the solar system, far beyond even the orbit of Pluto. Because they travel over such a huge distance, it takes them many years to complete an orbit.