There are a lot of rules for the passage of time in D&D. Most take to my tastes completely the wrong approach.

The most egregious place for this is during wilderness adventuring. In which time is measured in days. Over the course of a day, a party might lose direction, encounter monsters, change the environment they pass through, or any number of other occurences. It can be difficult as a referee to decide when these events happen.

The day is divided into 12 periods I'll call watches. Each is 2 hours long. I'll note that the idea of days beginning at midnight is a fairly modern concept, so we'll be beginning the day at 'roughly' sunrise. Obviously this is prone to move a little with seasons, but if you don't care about that degree of accuracy then simply don't worry about it.

Watch (1d12) Rough times Description
1 6am–8am Sunrise, Eating breakfast, taking down camp
2–3 8am–Noon The morning march
4 Noon-2pm Lunch, resting
5–6 2pm–6pm The afternoon march
7–8 6pm–10pm Setting up camp, dinner, campfire stories
9 10pm–Midnight First watch, twilight to dark
10 Midnight–2am Second watch, midnight
11 2am–4am Third watch, the graveyard shift
12 4am–6am Final watch, light before dawn

I'd recommend you either have a party predetermine their watch order, or you randomly roll which members of the party are on watch should they get attacked between the 9th and 12th watches at night.

You shouldn't roleplay through every watch in the day (though of course, you can if that's what your party is into). I recommend you simply use this table to decide which time of day you are cutting to when something interesting occurs.

Another important part of this is knowing how far you're able to travel in each watch of marching. There are 4 watches of marching over the course of the day, or about 8 hours. The distance covered in miles per watch is shown in the table beneath, this obviously varies based on the parties travel rate as well.

Terrain Party Base Movement Rate in Miles per Watch
240' 150' 120' 90'
60' 30'
Civilized 18 11 9 7 5 2
Light 12 8 6 5 3 2
Moderate 8 5 4 3 2 1
Difficult 6 4 3 2 2 1
Terrain Party Base Movement Rate in Miles per Day
240' 150' 120' 90' 60' 30'
Civilized 72 45 36 24 18 9
Light 48 30 24 18 9 6
Moderate 32 20 16 12 8 4
Difficult 24 15 12 9 6 3

Cizilized terrain is basically anywhere with roads, such as in large cities or between towns.
Light terrain is farmland, grasslands, or simillar.
Moderate terrain is deserts, forests, hills, or simillar.
Difficult terrain is jungles, mountains, swamps, or simillar.

You'll notice the numbers between the Miles per Watch and Miles per Day table don't add up exactly. This is because the latter is designed to be used to quickly move the party when nothing of note happens in a day, and the former is designed to be used to calculate travel distances if time is lost due to something happening, the party takes a non standard number of marches or watches (for example, doing a 6 watch forced march, instead of a normal 4 watch march). This is useful for positioning within whatever maps you use, and better giving a feeling of a dynamic and moving world.