Source Core Rulebook pg. 499
Characters require 8 hours of sleep each day. Though resting typically happens at night, a group gains the same benefits for resting during the day. Either way, they can gain the benefits of resting only once every 24 hours. A character who rests for 8 hours recovers in the following ways:
The character regains Hit Points equal to their Constitution modifier (minimum 1) multiplied by their level. If they rest without any shelter or comfort, you might reduce this healing by half (to a minimum of 1 HP).
The character loses the fatigued condition.
The character reduces the severity of the doomed and drained conditions by 1.
Most spellcasters need to rest before they regain their spells for the day.
A group in exploration mode can attempt to rest, but they aren’t entirely safe from danger, and their rest might be interrupted. The 8 hours of rest do not need to be consecutive, however, and after an interruption, characters can go back to sleep.
Sleeping in armor results in poor rest and causes a character to wake up fatigued. If a character would have recovered from fatigue, sleeping in armor prevents it.
If a character goes more than 16 hours without going to sleep, they become fatigued.
Taking long-term rest for faster recovery is part of downtime and can’t be done during exploration. See page 502 for these rules.
Source Core Rulebook pg. 502
Each full 24-hour period a character spends resting during downtime allows them to recover double what they would for an 8-hour rest (as listed on page 499). They must spend this time resting in a comfortable and secure location, typically in bed.
If they spend significantly longer in bed rest—usually from a few days to a week of downtime—they recover from all damage and most nonpermanent conditions. Characters affected by diseases, long-lasting poisons, or similar afflictions might need to continue attempting saves during downtime. Some curses, permanent injuries, and other situations that require magic or special care to remove don’t end automatically during long-term rest.