Hi Cody and Lindsey,
there are a bunch of things that influence rotation in a star or planets. Some of the rotation is left over from the spinning clod that formed the solar system. That is how we think the Sun gets most of its rotation.
There are other things that can influence rotation, though. Planet size may be important. Also, we think in the early history of the solar system there were lots of collisions between planets and other objects, like asteroids, that could change rotation period. Also it is possible to change a planet's rotation more gradually - the Earth and Moon affect each other's rotation period. The Moon is locked so that it rotates only ones every time it goes around the Earth. the Moon's affect on the Earth is not so obvious, but it is slowing down Earth's rotation very slowly.
Here is a web site you might like to look at:
http://www.exploratorium.edu/ronh/age/cheers,
Terry