The total time taken by two successive periods is constant, but the lengths of the light and dark period vary. One simple constant is noon. Noon is the time of the day when the Sun is at its highest position. Since the Earth is round, noon happens at different times in different places. This leads to the concept of local time .
Humans measure time in many units, most of which are tied to natural phenomena like noon.
As long as you stay in the same place, it doesn't matter that local times differ. As soon as you need to communicate with distant places, you'll notice the need for a common time. In modern times, most of the places in the world communicate with most other places in the world, so a global standard for measuring time has been defined. When people with different local times need to communicate, they can express times in universal time, so that there is no confusion about when things should happen. Each local time is called a time zone.