What's a Clock?
Clocks are not just a method to track time, but as a GM tool also serve other functions. A Time Clock tracks the in-character time in some way or another, which of course is not linearly related to RL time.
Progress Clocks instead track the progress of any kind which is not linearly related to IC time at all: you might track events, encounters or specific actions. Similarly but not equally, Trackers, such as Hit Point Boxes/tracks or slot-sheets can be seen as extensions of Clocks, and so get a little paragraph too.
Making a Clock
The method is used for example in Blades in the Dark or Apocalypse World but can easily be lifted from there. In general, determine how many actions or ticks are needed before the event that is connected to the clock triggers. Then, determine what is needed to fill a clock segment. Now, draw a circle or bar and add dividing lines to get the needed number of segments.
Often, a clock can run open and the players know what will happen when it is full, but at times the GM might keep its existence or fill status hidden, so as to not tip off players of things that happen in the background.
I have used a linear track clock aka Calender in a campaign, where certain events were pre-marked on it (such as holidays). Some events were only marked on my GM clock such as assaults on their town, and the arrival of reserves, while others were written down onto it when Player-actions happened, such as how long training of their units or side projects took.
When playing Shadowrun, the game naturally features two clocks in the physical and mental condition monitor tracks on the character sheets.1 As an extension, I went to use magazine sheets, where rows are the length of magazines. In L5R I similarly track HP... See also Tracker clocks.
NPC Location/opening days/hours
It's simple: every day, a segment is filled. The high priest is only available on Sundays, while public court is Friday and you can only on Monday to Friday you can apply for papers. If the day of the week plays any relevancy, use a 7-day clock, tick it once a day, and see in the associated list who's open when or where they are.
The extension of this is yet again the calender, typically using a linear track to demark holidays or special occasions that modify opening hours or the location of NPCs... you see, the flow from Clock to a full-fledged page-filling calendar almost comes naturally.
Does the group need to arrive in the next town before some event happens in 7 days? Give each day one or more segments. Typically 8-hour segments work great for clocks that depict travel time, using 3 segments per clock. A long rest thus would eat a whole segment, just like a day of marching eats another, and so on. The free space on the clock dwindles, creating urgency - when the clock is running out, bad things happen. At some point, there's no time for a long rest anymore, or the players need to take shortcuts to try and make their time...
Using shorter segments or possibly sub-clocks can help with tracking how far you are inside one of those 8-hour segments, e.g. using a second clock with 1 or 2-hour segments (4/8 pieces) to show how far you are inside that segment.
Time between Rests
As Groody explains, a Long Rest is pretty much resetting most rebounding resources. Unless it's a one-use item, it will return. But nothing penalizes players from doing one encounter, then doing a long rest in the core rules. Sure, a long rest takes 8 hours, and 6 of them are sleeping, and they can only benefit from one in a day, but if you don't have to be somewhere within a given time, nothing prevents players from resting after every single encounter (or even short resting till they can long rest again after each fight).
This is where visualizing the mandatory Time Gaps comes in. A GM might reason that you can only do a Long Rest every so many time segments. 24 hours are in the rule book, but the GM might want to extend this. Only when the clock is full, you can do a Long Rest. You don't need to do a long rest right then and there, but you also don't gather extra segments on a second clock. Showing players the time progress needed can be in essence one of the most simple fixes to the accessibility problem of Long Rest - it just shows that time progresses and players become a little more hesitant to spend a day idling to regain the long rest abilities. Do note, that there are other tweaks to try and dissuade such behavior as for example House DM suggests. In my opinion, it's most certainly still more accessible with a modified time gap than requiring an inn.
How do you determine when to fill such a segment? The rules say it's 16 hours passed, but the DM might instead want it to be an encounter for each segment, a number of short rests, or it might be a day of adventuring for each - in any way: limiting long rests this way (or even more restrictive: limiting it to safe locations as House DM suggested) will seriously impact the power balance between classes that refresh on short rests compared to long rests - the short rest classes get proportionally stronger, as DNDShorts summarizes.
The Players are in a dungeon or somewhere where being loud or messy might be bad? Well, whenever they make a lot of noise, such as fighting, or leave behind corpses, one or more segments are filled. When the clock fills, following encounters get more dangerous: The enemy will be more alert, up their numbers, or lock doors.
Something similar exists baked into Shadowrun 5th edition, where any illegal activities in the Matrix create Overwatch Score - once that hits 40, the Matrix police show up and hits you. It just isn't natively visualized as a clock.2
If the side project takes a certain number of rolls, days or successes, tracking that as clocks makes it easy to track - When the clock is full, it's done!
I used a linear track in The Dark Eye 4.1 to account for the number of skill points that went into the project with each roll during a campaign, as it was easier to do than to keep track of summed-up numbers of these points as the game suggests.
The Evil Plan's progress
The clock can show the progress of the adversary. Whenever a clock segment is filled, the adversary has achieved a certain goal. When the clock is filled, they have fulfilled a major target. When a given number of clocks is full, the adversary won. Players need to finish the adventure before the adversary wins, and if the adversary has filled clocks, each one makes the final showdown harder.
Assume that one group is hunting another. The running group needs to fill their clock to reach a specific point of safety. The hunting group succeeds the moment they have the same number or one more segment filled than the hunted group (depending on the rules used). Success on the rolls fills the respective clock, possibly by more than one segment each.
Or you do this with one clock as a tug-of-war, speaking of the distance between the two: The clock starts half-filled. The group that wins their roll either fills (hunting) or empties (running) one or more segments. If the clock is full, the trackers catch their prey, if it's empty, the group got away.
A different type of clock is for tracking resources. A barbarian's rage is X minutes? Make a clock with X segments and using a minute of rage fills one. Do you have spell slots? Visualize them as clocks or tracks. Do you play a game with ammunition and non-bottomless magazines? Make a clock out of it! Because a track is nothing but a linear clock. And once your reset condition triggers... empty the clocks. This is in my experience adequate, even if you track highly volatile resources.
Technically, this isn't a fully separate type from Time or Progress Clocks, but a subtype. In general, it's a device for a GM to get players to pay attention or create suspense. It might track something, for example, the time or progress through a dungeon, but once the clock is full, nothing happens.
However, it might be useful anyway if you play with narrative descriptions, such as tracking the time of day that is outside of the dungeon. While such a clock has no mechanical impact, it can help with immersion and thus get the players' heads into the game.
1 - See the official Shadowrun Character sheets for 1st Edition, 2nd Edition, 3rd Edition, 4th Edition 5th Edition, and 6th Edition
2 - Shadowrun 5th Edition, Core rules, 2nd printing, p.232