We have a 24-hour day because that is
The length of time it takes for the moon to travel around the Earth.
The length of time it takes the Earth to rotate once around its axis.
The length of time it takes the Earth to travel once around the sun.
The length of time it takes the sun to rotate once around its axis.