The Earth's motion around its own axis, as the terrestrial axis is the imaginary line that passes through the poles, has a duration or rotation, i.e. period to make a complete counterclockwise rotation on its axis, called day. Actually there are different types of "day" depending on the reference for measurement.
The day commonly adopted, where each day is made of 24 hours is a scientific convention unrelated to the effective duration of the Earth day.
The days for all the planets and any objects rotating around the Sun are the following:
The sidereal day, i.e. the time the Earth needs to rotate once around its axis referring to the stars. Since the stars can be considered fixed, as very far, therefore the day is the time when these stars reappear at the same point in the sky after the full rotation of the Earth. The duration is exactly 23h 56m 04s long.
The solar day, the time the Earth needs to rotate on its axis relative to the Sun. Considering the apparent motion of the Sun to an observer on the Earth, we can say that is the time interval in which the Sun passes through the same point on the meridian considered by the observer.
This day is longer than the sidereal, as the Earth does not only rotate, but in the meantime it has also shifted due to its revolution around the Sun. So it is not enough that the Earth has rotated 360 degrees, but still it has to rotate something more to find the Sun in the same position.
The cause of this difference is due to the fact that time the Earth in its orbit around the Sun moves of about one degree along its orbit each day (360 degrees / 365.25 days for a full orbit = 0 °, 986 degree per day).
Please observe the figure at the bottom of the page.
So the Earth must rotate nearly 361 degrees to let it appear that the Sun has done 360 degrees in the sky. Actually, as written above, to return to the same point towards the Sun must compensate for the distance traveled along the orbit during the day (1 degree ), with an additional rotation, rotation that requires more than just 4 minutes (it takes (24 h / 360 °) * 0 °, 986 = 3m 56s.)
Therefore for all planets that rotate in the same direction of their revolution around the Sun, the solar day is longer than the sidereal day by about 4 minutes. Continuing to add four minutes every day, after 6 months the sidereal day indicates noon, whereas the solar day indicates midnight. For this reason, the sidereal day is not considered for the measurement of time. Moreover the solar day is not constant, however as explained in the next paragraph on the Revolution.
The mean solar day or civil day is the calendar day of constant duration of 24 hours.
This could be if the Earth had a perfectly circular orbit around the Sun, but as discussed below this is an ellipse, this rotation depends on the position of the sun throughout the year. Hence the need to define a day of exactly 24 hours, as the average durations of all the days of the year. According to this day we have definitions of minutes and second, as the 86,400th part of the mean solar day (24 hours x 60 minutes x 60 seconds = 86,400 seconds in a day).
This picture is showing the additional angle alpha, needed in rotation to faces the Sun at the same point of the day before.