Halachot of Sleep
The Torah attributes significance to all of a person's daily actions and there are halachic guidelines on how a Jew should conduct himself from the time he wakes up until he goes to sleep. See a closely related topic Bedtime Shema for the halachos regarding saying Shema before going to sleep.
Time to Go to Sleep
- According to the Zohar, for spiritual and health reasons, it is proper to sleep in the beginning of the night and to learn Torah during the second half of the night. However the Talmud Bavli and Rambam hold that it is healthy to sleep in the end of the night until Amud HaShachar.
- If one will fall asleep during prayer due to the fact that one woke up too early, one can sleep later but should be careful not to miss prayer with a minyan.
Duration of Sleep
- One is not meant to sleep longer than 8 hours or less than 6 hours, one may vary within those parameters according to one's needs.
Sleeping Alone in a Room
- One should not sleep alone in a room at night. However, if there are others in the same house sleeping in other rooms, one should leave the room door ajar at night (unless a man is sleeping alone in a room and the only other person in the house is a women in which case it is forbidden to leave the door open because of Yichud.) 
- Some hold that it is enough to have the door closed and unlocked. 
Sleeping in Shul or Bet Midrash
Correct Position to Sleep In
- One should sleep on one’s side and not face up or down. 
- One may place one's bed in any direction that one wants, however if possible it is preferable to situate the head of the bed in the east and the foot of the bed in the west.
- One should not sleep with one’s head or feet directly facing the door "in a position that it looks like one was about to be taken out of the room".
Clothes to Wear to Sleep
- There is a custom to sleep with one’s Yarmalka on one’s head. See also Kippah#Wearing_a_Kippah_to_sleep. 
- There is a custom to sleep with one’s Tzitzit (Tallit katan). See the Tzizit page.
- The minhag is to allow sleeping in one’s regular daytime clothes.  However, one should remove one's shoes when going to sleep. There is a discussion if the same applies to a short nap.
Sleeping during the Day
- A person should refrain from sleeping during the day more than “Shitin Nishmei” which some explain as being more than 3 minutes, others say it is half hour, and yet others maintain it is 3 hours. Therefore, a person should be careful not to sleep during the day unless sleeping will result in one afterwards serving Hashem more effectively. 
- On Shabbat it is permitted to sleep during the day. However, one should not sleep too much because it will take away from one's time to learn Torah on Shabbat.
- One who stays up all night to learn Torah may sleep during the day as is the custom on Shavuot morning.
- A person who sleeps during the day for longer than Shitin Nishmei should wash their hands without a bracha. 
- No bracha of HaMapil or "Veyahi Noam" is said before going to sleep during the day and no "Elokei Nishama" is said upon waking up. 
Placing Items under a Bed
- One may not place food even if it is covered under a bed because there is a concern that ruach raah coming upon it. This applies to raw or cooked food and even water.
- If one already put food under a bed some poskim hold that the food may be eaten, while others say that it should be thrown out.
- Some say that this ruach raah only applies to food that was under a bed when someone was sleeping on it, but others disagree.
- There is a discussion if this concern also applies to a bed of a non-Jew.
- Some say that there is no concern of placing food underneath one's pillow.
- There is no concern of ruach raah on utensils other than food.
- Mishlei 3:6
- Rashi (Bamidbar 23:24) writes that when a Jew wakes up he should wake up like a lion in order to perform mitzvot with alacrity. This idea is also found in Shulchan Aruch 1:1. Additionally, Rashi continues, before going to sleep a Jew makes sure to say Shema and entrusts their soul to Hashem.
- Brachot 3b relates the story of King David who slept in the first half of the night to then wake up and learn after Chatzot. This practice of sleep in the beginning of the night is praised in a few places in the Zohar (Noach 72a, Toldot 136c, Beshalach 46a, Vayahakel 185b, Vayikra 13a). So writes the Sh"t Arugot Bosem O"C 1 that the learning at night should be done primarily after Chatzot. However, Sh"t Chatam Sofer 31 (Jerusalem 5733 edition) writes that the majority practice is to learn in the first half of the night and to sleep after Chatzot. Rav Ovadyah in Sh"t Yabia Omer Y"D 7:20(2) supports this from the Gemara Yoma 22a (and others) that it is preferable to stay up late learning rather than go to sleep early and subsequently wake up early. This is codified in Yalkut Yosef (edition 5764, vol 1 pg 75). [Halacha Brurah (Birur Halacha 1:1) writes that Rav Ovadyah's practice was to learn until after Chatzot and then sleep until morning.] Halacha Brurah (Birur Halacha 1:1) quoting the Zohar (Vayakel 195b) and Rambam (Deot 4:4) writes that regardless which method one chooses, it is proper to be awake at Chatzot to learn Torah. [Machazik Bracha 1:1 wonders why the Shulchan Aruch left this Halacha out of his work, since it leads people to be lax in this law.]
- Eliyah Rabba 1:2, Pri Megadim, (quoted by Pitchei Teshuva 1:1), Halacha Brurah 1:1
- Some sources suggest that one should sleep 8 hours such as the Rambam (Deot 4:4) and Orchot Rabbeinu (1 pg 189, biography of the Steipler). Some quote Mishna Brurah 1:9 to argue that one should sleep as much as one needs. If one however carefully reads the whole sentence there, one will see that the Mishna Brurah is speaking about someone who is weak and afraid that, should they not get enough sleep it will result in them falling asleep during davening. Baer Heitev 1:6 says the correct amount of sleep is a subjective measure and some people may need more than others. Yalkut Yosef (edition 5764, vol 1 pg 64) writes that it is unhealthy to sleep more than 8 or less than 6 hours. Aruch HaShulchan says that some learn from the pasuk "Yashanti Az Yanuach Li" that one should sleep 8 hours because the gematria of "Az" is 8, yet others maintain since the gematria (mispar katan) of "Li" is 4 one should sleep 4 hours, but concludes that it all depends on the health and age of the person.
- Kitzur Shulchan Aruch 71:2 disagrees and writes one should not sleep alone in a room. Mishna Brurah 239:9 states one should not sleep alone in a room at night. However, Shaar HaTziyun 239:17 writes when there are others in the house it can be made permissible by leaving the door ajar. Yalkut Yosef (Brachot pg 669, Sherit Yosef vol 3 pg 369) also holds that it is forbidden. He however writes if one has no other option than to sleep alone in the room, one should at least leave a light on in the room. Rav Mordechai Eliyahu (comments to Kitzur Shulchan Aruch 71:2) agrees.
- Piskei Teshuvot 239:6, BeYitzchak Yikra of Rav Neventzal 239:6
- Shulchan Aruch OC 63:1. Shulchan Aruch Even Haezer 23:3 says that it is prohibited to sleep on one's back, but leaves out the prohibition to sleep on one's stomach. Mishna Brurah 239:6 says that it is a severe prohibition to sleep on one's back or stomach and one should sleep on one's side. Shalmat Chaim 224 states that the correct position to sleep in should be reinforced with children at the age of nine.
- Shulchan Aruch 3:6 writes that one should arrange one's bed so that one's feet are towards the south and head towards the north. However, Kaf HaChaim 3:16 cites the opinion of the zohar that one's feet should be in the west direction and head towards the east. Kaf HaChaim sides with the opinion of the zohar though he adds that either opinion is acceptable. Similarly, Or Letzion (vol 2 chap 1:1) writes that one may place one's bed in any direction but it is preferable to follow the zohar. Moreshet.co.il cites Rav Mordechai Eliyahu in Darkei Tahara as accepting both views. ykr.org also favors the opinion of the zohar.
- Halachically Speaking (vol 3, article 1, pg 2) quoting Rav Yisrael Belsky
- Mishna Brurah 2:11
- Mishna Brurah 21:15
- Halachically Speaking (vol 3, article 1, pg 5)
- Rabbi Eli Mansour on dailyhalacha.com, Ben Ish Chai Parashat Pinchas: Halacha 16, Kaf Hachaim YD 116:211
- see Rabbi Eli Mansour on dailyhalacha.com
- S”A 4:16 writes that a person should not sleep more than Shitin Nishmei. The Rama limits this stringency to the daytime. Halachically Speaking (vol 3, article 1, pg 4) writes that there are some lenient opinions about sleeping during the day but the general consensus is that one should not sleep during the day unless one needs to do so to serve Hashem more effectively. Beiur Halacha 4:16 s.v. David quotes three opinions on the length of Shitin Nishmei; some say it is more than 3 minutes, some say a half hour, and some say 3 hours. Mishna Brurah 4:36 concludes with a quote from the Machasit HaShekel that sleeping during the day depends on each person’s individual needs to be able to serve Hashem in the most effective way possible. (The Beiur Halacha 4:16 s.v. David reaches a similar conclusion). Piskei Teshuvot 231:1 writes that the Halacha follows the opinion that Shitin Nishmei is slightly longer than a half hour.
- Mishna Brurah 4:36
- Mishna Brurah 290:3
- Halachically Speaking (vol 3, article 1, pg 4)
- S”A 4:15 writes that there is a doubt whether one who sleeps during the day should wash their hands with a bracha or not and so the Rama concludes that one should wash without a bracha. Mishna Brurah 4:34 writes that this only applies if one sleeps more than Shitin Nishmei.
- Mishna Brurah 231:2, Piskei Teshuvot 231:1
- Shach 116:4, Pri Chadash 116:6 based on Gemara Pesachim 112a and Bava Batra 58a
- Gemara Pesachim 112a, Shulchan Aruch YD 116:5
- Pitchei Teshuva 116:5 citing the Binat Adam 63
- Pitchei Teshuva 116:4 citing the Shvut Yakov 2:105 writes that after the fact if the food was under the bed it is still permissible to eat it. However, the Binat Adam 63 quotes the Gra as holding that one should throw away the food. Rav Ovadia Yosef in Yabia Omer YD 1:9 concludes that if there's a large loss the food doesn't have to be thrown out and if no one slept on the bed when the food was there it is permitted after the fact even if it isn't a large loss.
- Torat Chaim Bava Batra 58b writes that the ruach raah is a result of the tumah that descends upon a person who is sleeping, which is akin to death, and transfers to anything under him. However, the Darkei Teshuva 116:38 quotes the Or Yitzchak 14 who writes that this applies even to food under a bed that no one slept in. See Pri Hasadeh 5.
- The Darkei Teshuva 116:39 cites a discussion about food under a bed of a non-Jew. The Degel Efraim 28 holds that there is ruach raah. The Teshurat Shay 2:116 writes that there's no concern of ruach raah under a bed of a non-Jew.
- Darkei Teshuva 116:37 quotes the Mizmor Ldovid who holds that there's no concern of ruach raah under one's pillow.
- Darkei Teshuva 116:36 quoting the Or Yitzchak 14