What would happen if gravity was the only force acting on the planet

eh? It is the only force acting on the planet.

well, maybe some friction from the solar wind, but that's not much.