The Earth’s rotation is the amount of time that it takes to turn around once on its axis. There are actually two different kinds of rotation that you need to consider here. How long does it take for the Earth to turn once on its axis so that it returns to the same orientation compared to the Universe, and how long does it take for the Earth to turn so that the Sun returns to the same spot in the sky.
Let’s answer the second question first. It takes exactly 24 hours for the Sun to return to the same spot in the sky. It’s obvious, right? That’s a day. But the second question is more interesting. It actually takes the Earth 23 hours, 56 minutes, and 4.09 seconds to turn once on its axis compared to the background stars.
So why is there a different. The amount of time it takes for the Earth to turn on its axis is known as the sidereal day. And the amount of time it takes for the Sun to return to the same spot is called a solar day. The difference comes from the fact that the Earth is orbiting around the Sun, completing one orbit in just over 365 days. If you divide 24 hours by 365 days, you’ll see that you’re left with about 4 minutes per day. In other words, the Earth rotates on its axis, but it’s also orbiting around the Sun, so the Sun’s position in the sky catches up by 4 minutes each day.
The Earth’s rotation velocity at the equator is 1,674.4 km/h. Just by standing on the equator, you’re already traveling 1,674.4 km/h in a circle. This rapid rotation flattens out the Earth into an oblate spheroid; sort of a squished ball. Points along the equator are actually further from the center of the Earth than at the poles.
The rotation of the Earth comes from the angular momentum of all the particles that came together to create the Earth 4.6 billion years ago. The Earth, the Sun and the rest of the Solar System were once part of a giant molecular cloud of hydrogen and other elements. As the cloud collapsed down, the momentum of all the particles set the cloud spinning. This is why the Sun spins, and even with the Earth and the Moon all rotate on their axes.