The Sun does rotate, but not all at the same rate. While the Earth takes 24 hours to do one rotation, whether you are standing at the equator or close to either the South or North Pole, the Sun actually rotates fastest at its equator.
On the Sun’s equator any point takes 24.47 days to rotate completely around the star but as you get close to either of the Sun’s poles it can take up to 38 days. These measurements have been made by using sunspots as tracers of the surface and watching them turn with the star.
Astronomers usually work with the rotation rate of an area about 26 degrees above or below the equator as this is where the most sunspots are observed. At this latitude, one complete rotation takes just over 27 days and this is known as a Carrington rotation.
Answered by Megan Whewell from the National Space Centre