Depending on the composition of the object, once you have enough mass (and hence gravitational attraction) to deform the material and cause it to flow it will form a sphere. This is because a sphere is the lowest energy configuration everything on the surface of a sphere is at the same gravitational potential, so theres no tendency for it to fall to another position.
True spheres are almost never found. Conservation of angular momentum during accretion causes objects to rotate. This rotation naturally causes object to bulge around their equator and flatten at the poles.
Hope this helps.
Garde la Foi, mes amis! Nous nous sommes les sauveurs de la République! Maintenant et Toujours!
(Keep the Faith, my friends! We are the saviors of the Republic! Now and Forever!)
LonePalm, le Républicain du verre cassé (The Broken Glass Republican)
The material needs to be maleable, so that gravitational effects can work. The moon is thought to be the debris from a large collision with the Earth. Such a collision would generate tremendous amounts of heat, which would soften the solid matter. As a result both the Moon and the Earth compressed themselves into spheres before they soldified. As LonePalm noted, each point on the surface of a sphere is equidistant from the center