Dear Student ,
The gravitational force between earth and the moon gives the centripetal force to the moon for orbiting the earth . and all the planets are known for orbiting around sun is all due to the gravitational forces between the sun and the planets that provides the necessary centripetal force .
Regards