A planetary body was any secondary or significantly substantial planet-like object that was in orbit of a star, which included dwarf planets, moons, asteroids, protoplanets, planetesimals, or comets.
After analyzing the doomsday machine encountered by the USS Constellation and USS Enterprise in 2267, Spock determined that it was self-sustaining as long as there were planetary bodies for it to feed on. (TOS: "The Doomsday Machine")
After locating the USS Pegasus inside asteroid Gamma-601, Admiral Erik Pressman ordered the USS Enterprise-D to enter the chasm. When Captain Jean-Luc Picard questioned the order, Commander Data explained that "It is theoretically possible, sir, but I am unaware of any prior situations where a starship was taken so deeply inside a planetary body. There may be unforeseen difficulties." (TNG: "The Pegasus")