Planets usually attain their
rotation when they are formed, taking angular momentum from the influences that
form them. There is a connection among the total mass of a planet and the roral
speed of its rotation, excluding where tidal forces have decelerated planets and
made their days longer.
Source
SPACE.com: All about our solar system, outer space and exploration.