One planet turn with respect to fixed stars
In astronomy, we are only interested in the rotational period of the Earth relative to so called fixed stars and not the Sun. We therefore use a time scale that is dedicated to determining the time the Earth takes to turn 360 degrees with respect to the stars. This rotational period is a sidereal day.
A sidereal day is the time a planet takes to turn once on its axis, with respect to a fixed point in the sky, independently of its orbit around the Sun.
In the case of the Earth, a sidereal day is defined as the period between two successive transits of the vernal equinox– where the sun sits in the sky at the first moment of northern hemisphere spring.
The length of a tropical year is 365.2422 solar days. This is the number of times Earth turns on its axis in one solar year.
However, in the same time but with respect to the stars, the Earth turns one extra time, ie 366.2422 times: so a tropical year lasts 366.2422 sidereal days. A sidereal day is therefore 365.2422/366.2422 = 0.997269 solar days, or 23h 56m 4,09s.
In practice we also use the average sidereal day, which takes into account the movement of the pole.