This question already has an answer here:
Recently, I finished gravitation. I wonder why the shapes of planets or any body revolving around any star are not cubical or ellipsoidal. In our solar system all the planets are spherical in shape. Why isn't a body of any other shape found revolving around the gravitational field of any star?