Beds appear primarily in The Sky and can be slept in order to restore hearts or change the time of day. Link has his own bed in his room at the Knight Academy, though humorously he can sleep in other people's beds, even Zelda's bed in Zelda's Room once he has managed to sneak inside and unlock the door.
Beedle's Air Shop has a bed inside and Link can sleep in it to visit Beedle's Island at night. Additionally the beds in the Lumpy Pumpkin can be used to visit Pumpkin Landing at night. As a result, they allow Link to visit other areas in the sky besides Skyloft at night as he is unable to fly his Loftwing at night.
In the 3DS remake of Ocarina of Time, Link can sleep in his bed in Link's House to restore health. It also allows him to battle bosses he has previously defeated.
Beds can be found mainly at Inns, Stables, the Woodcutter's House, the archeologist's cabin at Fort Hateno, Hebra Trailhead Lodge, Selmie's Spot, Pondo's Lodge, and Link's House. Like Campfires and Cooking Pots, they can be used to pass the time to morning, noon, or night. However unlike Campfires, sleeping in a bed restores Heart Containers. Some inns even off special beds or additional services that add temporary yellow hearts or a yellow stamina wheel though cost more than the standard bed. While most inns require Link to pay to sleep the Deku Tree's Navel Inn in Korok Forest allows Link to sleep for free due to the bed in the inn being made especially for him to sleep in due to his heroic status. Link can also sleep for free in the beds found in the Woodcutter's House, the cabin at Fort Hateno, Hebra Trailhead Lodge, Selmie's Spot, and Pondo's Lodge.
As part of the "Hylian Homeowner" Side Quest, Link can purchase a house for himself from Bolson in Hateno Village for 3,000 Rupees and 30 bundles of Wood. After purchasing the house, Link can sleep in his bed any time he's in Hateno Village. However free beds do not offer any benefits other than health restoration and passing time.