Therefore, one must be more careful regarding nighttime study than daytime study, and for one who neglects it, his punishment is great. They said in Eruvin (65a): "The moon was only created for study," and they said there: "The night was only created for sleep," and the Tosafot wrote that this refers to, for example, the nights of the Tammuz solstice; see there. There is one who explained that the language of the Gemara in the first statement, "The moon was only created for study," means that at the beginning of creation the night was total darkness, and since the time the luminaries were hung, it has light by means of the moon; however, for most of the month the moon does not shine the entire night. Therefore, at the time when the night is actual darkness, it is a time to sleep, and when the moon shines, it is a time for study (Maharsha). The great authorities wrote that from Shavuot, on which we read Ruth, wherein it is written: "Lie down until the morning," until Tisha B'Av, of which it is written in Eicha: "Arise, cry out in the night" — "lie down," meaning that the nights are short and there is no need to study at night. And from "arise," which is Tisha B'Av, until "lie down," which is Shavuot — "arise," meaning one must arise and study at night (Magen Avraham and Bach). They wrote that the measure of sleep is eight hours, as it is said: "I would have slept, then I would have been at rest [yinuach li]," and "then" [az] is numerically eight. And some wrote four hours, that when "I would have slept, then [az]" there would be rest for the number of "li," forty hours. The truth is that everything is according to his weakness or strength and according to the number of his days, and everything should be for the sake of Heaven.
ולכן צריך ליזהר בלימוד הלילה יותר מביום, והמבטלו עונשו מרובה. ואמרו בעירובין (ס"ה.): "לא איברי סיהרא אלא לגירסא", ואמרו שם: "לא איברי ליליא אלא לשינתא", וכתבו התוספות כגון לילי תקופת תמוז ע"ש. ויש מי שפירש דלשון הגמרא במאמר הראשון: 'לא איברי סיהרא אלא לגירסא', כלומר דהלילה בתחלת הבריאה היה חשך גמור, ומזמן תליית המאורות יש לה אור על ידי הלבנה, ורובו של חדש אין הלבנה מאירה כל הלילה, ולכן בזמן שהוא לילה חשך ממש הוי זמן לישן, וכשהלבנה מאירה הוי זמן לימוד (מהרש"א). והגדולים כתבו דמשבועות שקורין בו רות, דכתיב בה: "שכבי עד הבוקר", עד תשעה באב דכתיב באיכה: "קומי רוני בלילה" – שכבי, כלומר דהלילות קצרים ואין צריך ללמוד בלילה. ומ"קומי", דהיינו תשעה באב, עד "שכבי", דהיינו שבועות – קומי, כלומר צריך לקום וללמוד בלילה (מג"א וב"ח). וכתבו ששיעור שינה ח' שעות, שנאמר: "ישנתי אז ינוח לי", 'ואז' במספר שמנה. ויש שכתבו ד' שעות, כשישנתי 'אז' ינוח מספר 'לי', ארבעים שעות. והאמת הכל לפי חולשתו וגבורתו ולפי מספר ימיו, והכל לשם שמים.