Our Earth rotates constantly and the position of the stars in the sky changes as well. If the camera exposes too long the stars will look like short lines in the photo instead of points. That is called star trails. Sometimes it is wanted and sometimes not. To avoid star trails all you have to do is follow the ‘500 rule’:
Find out the focal length of your lens, for example it can be 16mm. Now divide the number 500 by the focal length you found. Lets round the result 31 to 30. This means you can have a maximum exposure of 30 seconds. Any longer and star trails will be visible.
There one last important thing for this rule. As such, this rule only for full frame cameras. Cropped cameras (DX, APS-C, Micro four thirds, etc)  have a so-called crop factor or focal length multiplier. If you are not sure, you can find the specifications for most cameras here. Lets say a camera has a crop factor of 1,5 and a 16mm lens. Now the calculation is 500 / (16mm x 1,5 crop factor ) -> 500/24 = 20 seconds.
The movement of stars can also be used for creative photography: