Rest

Rest is simply another word for sleep. Rest is required to level up (except in Skyrim), 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.

Benefits
When you aren't a Werewolf or don't have The Lover Stone active, sleeping in a bed gives you benefits to your stats. There are three states of rested with each its own stat bonus:

Rested
When you sleep in an owned bed, but one you've been given permission to use, you will gain the "Rested" status. While having the rested status, you will gain 5% more experience for 8 hours.

Well Rested
When you sleep in an Inn or in a bed you own yourself, you will gain the "Well Rested" status. While this status is active, your stats will gain 10% more experience for 8 hours.

Lover's Comfort
When you had a Marriage, and thus have a spouse, and you sleep in the same house as your spouse does, you gain the Lover's Comfort status. The Lover's Comfort gives you a 15% experience boost for 8 hours while active. If you have the The Lover Stone active, this boost will stay until you get another Stone's blessing. This is the only state of "Rested" that you can get when The Lover Stone is active.

Bug:

There's a bug that doesn't give you the Lover's Comfort status after awakening, this can be fixed easily without any console command, read Lover's Comfort.