There is your clock, e.g. 48 MHz or 60 MHz. There is a peripheral clock divider, by default set to 4. There are Timers that count the clock and they can be divided further.
Depending on the total divider, you have to count to a number that represents 1 sec. If peripheral clock divider is 1 and you run with 48 MHz the counter has to count 48 Million clocks during one sec.
In case you are talking about RTC, the same logic applies. If you have an external 32 kHz clock, the divider is easier and it can be used during low power state.
Much more details in the User Manual
hth, Bob