The distinction is between atoms and planets in "perpetual motion", and "perpetual motion machines". A perpetual motion machine would have to output more energy than is put into it, in order to overcome the continual energy-draining effect of friction, and the law of conservation of energy forbids that. Incidentally, even planets and stars are not in perpetual motion. They bump into interstellar hydrogen molecules, transferring a bit of kinetic energy each time. This process, slow as it is, will eventually drain away the large object's kinetic energy if given an eternity.