I know that the earth moves around the sun because of the gravity force, because the spacetime around the sun is curved.
But why does the earth rotate on its axis, and which parameters can affect this motion?
I know that the earth moves around the sun because of the gravity force, because the spacetime around the sun is curved.
But why does the earth rotate on its axis, and which parameters can affect this motion?
The dominant hypothesis regarding the formation of the Moon is that a Mars-sized object collided with the proto-Earth 4.5 billion years ago. The Earth is rotating now because of that collision 4.5 billion years ago.
As the linked question shows, angular momentum is a conserved quantity. Just as something has to happen to make a moving object change its linear momentum, something has to happen to make a rotating object change its angular momentum. That "something" is called force in the case of linear momentum, torque in the case of angular momentum.
External torques do act on the Earth. Tidal forces transfer angular momentum from the Earth's rotation to the Moon's orbit. The Moon formed fairly close to the Earth shortly after that giant impact 4.5 billion years ago, and a day was probably only four to six hours long back then. By a billion years ago, the Moon had retreated significantly and the Earth had slowed down so that a day was 18 to 21 hours long. The Earth has continued slowing down, and will continue to do so.
If those external torques didn't exist we would still have a fast spinning Earth.
As David Hammen points out, individual interactions and collisions are extremely important in determining the individual spins of planets and the explanation involving a very large moon-forming collision is almost certainly a major factor in determining the Earth's original spin. However, there are more fundamental reasons why all the planets should spin and that, in the absence of catastrophic collisions or other later interactions, the spin vector should roughly align with the orbital angular momentum.
The solar system formed from the gravitational collapse of an unstable core, that itself would have formed within a turbulent cloud of gas in the interstellar medium. If one just takes a volume from within a turbulent gas it will inevitably have a certain amount of angular momentum, even if the whole cloud has zero net spin angular momentum.
As the core collapses it will spin up, but conservation of angular momentum will result in a flattened disk of material that orbits the protosun. It cannot accrete directly onto the protosun because of its angular momentum.
After a few million years the disk begins to clear. The specifics of this process are poorly understood, but it appears that some of the gas is accreted, some of it is blown away and some of it coagulates to form dust and small "planetesimals". These planetesimals orbit the Sun and ultimately stick together or, in the outer parts of the solar system accrete gas, to form the planets.
Consider a rotating disk of gas and planetesimals. Kepler's 3rd law tells us that orbital period $P$ is related to distance from the Sun $a$ as $P^2 \propto a^3$. Hence orbital speed $v \propto a^{-1/2}$ and specific orbital angular momentum $L \propto a^{1/2}$.
Now consider a protoplanet accreting material from the disk around it. Material will be drawn from both inside and outside its current orbit. The material inside and outside have different specific orbital angular momentum, but the density of the disk will also decrease with radius. The accretion will apply a torque to the protoplanet. The details are tricky - I tried to think of a back-of-the-envelope way of doing the calculation, but failed. For the inner terrestrial planets, there will be a lot of stochasticity because the final collisions will impart the most angular momentum and could completely change things. The gas giants are more predictable, the gas flows will tend to impart spin angular momentum in the same direction as the orbital angular momentum, although even here, turbulence within the disk, magnetic fields and migration inwards or outwards through the disk leads to more (difficult to model) complexity. The image below is a snapshot (of gas density) from a simulation run by Richard Nelson at Queen Mary College, London. You can probably convince yourself from looking at this picture that the protoplanet is accreting angular momentum with a vector direction into the picture, which is the same direction as the orbital angular momentum in the simulation.
The point is that there will always be some angular momentum accreted from the protoplanetary disk even in the absence of any major collision events.
After the disk has cleared to leave the formed planetary system then tidal forces are the most important issue in the Earth-Moon system. Tidal torques are gradually transferring angular momentum from the spin of the Earth to the Earth-Moon orbit.
I'm not aware of any detailed measurements that reveal the spin-down of the other planets in the solar system.