Rest is simply another word for sleep. Rest is required to level up, to become a vampire, and participate in certain quests such as the anvil recommendation and joining the Dark Brotherhood. If you sleep, your fatigue, magicka (unless you have the Atronach birthsign), and health will restore to maximum. The amount of fatigue, magicka, and health restored is irrelevant to the amount of time slept; sleeping just one hour will restore all bars to maximum.
Waiting does not count as rest nor does sitting on chairs or benches. You cannot rest in a bed that is owned by someone else. It is also impossible to rest when you are trespassing. Most guilds have beds that are free for members to use. You can also purchase a bed for a night at an Inn and when you buy a house it comes with a bed.