As long as humans have lived on Earth, the day has been 24 hours long. But humans are just a blip in the history of the planet. Not long after the Earth formed more than four billion years ago, a day was less than ten hours long. Four hundred million years ago there were 400 22-hour days in a year.
Why the changes? Earthquakes, hurricanes, ice ages, even El Niño have an effect. But the greatest influence comes from tidal friction, or gravitational forces between Earth and the moon. Tidal friction causes the planet to spin more slowly, so that our day is getting longer by 20 seconds every million years. No need to adjust your clock