The gemara in Niddah 17a reads:
Rav Hisda says: One should not have intercourse during the day, as it is stated: “And you shall love your fellow as yourself” From where is this inferred? Abaye says: Since the husband may see some repulsive matter in his wife and she will become repugnant to him.
R. Hisda explains his objection to having relations during the day: the husband may see something that will repulse him. In other words, the objection is not to having relations during daytime hours per se, but rather a concern about what he might see.
What is R. Hisda's concern? What might he see in the day that he does not see at night, or any other time when not engaged in relations? Presumably the concern is that a man is not used to seeing his wife naked; when he does, he may see her in a different light, and this would be a transgression of "And you shall love your fellow as yourself."
Later in the sugya we read:
R. Huna said: The people of Israel are holy, and do not have relations during the day.
Seemingly, R. Huna objects to daytime sexual relations per se. However, the gemara continues:
Rava said: And if the house was darkened – this is permitted, and if he is a scholar (talmid hakham) – he can cover the candle with his garment and have relations.
Rava's comment returns us to the original source of the problem, which is not relations during the day per se, but rather a question of having relations in the light rather than darkness. Relations are permitted in a darkened room, and a scholar can use his garment to cover the light and then have relations.
Why is this permitted in the case of a scholar? Rashi explains:
He knows how to maintain modesty.
In other words, a talmid hakham is modest and won't look where he should not, even if he has light.
The gemara continues and brings various sources which imply that daytime relations are permissible:
We learned in the mishna: […] or she should have intercourse by the light of a lamp. Perhaps the mishna should read: She should examine herself by the light of a lamp [but not have intercourse by the light of a lamp]. Come and hear [a baraita]: Even though the Sages said that one who engages in intercourse by the light of a lamp is repulsive, we can say that one who examines his bed in candlelight is repulsive.
The gemara concludes that the version which states that one may have intercourse by lamplight should be corrected to examining (a bedikah cloth) by lamplight; in other words, there is still a prohibition to have intercourse by lamplight.
However, the gemara later cites a source that praises the house of Monbaz, who would have sexual relations during the day1 :
Come and hear [a baraita]: The house of Monbaz would do three things that were mentioned favorably by the Sages: They would engage in intercourse by day […] we learn from here that they would engage in intercourse by day! Perhaps we should say that they would examine their beds by day; this is reasonable, since if you say they engage in intercourse by day, would the Sages have mentioned them favorably for this practice? Yes, it is indeed so: since at night there is a risk of being overcome by sleep, and consequently the wife [who desires sexual intercourse] might be repulsive to him.
The gemara concludes that if having relations at night is challenging, it is permitted to have relations during the day. Rashi explains:
Being overcome by sleep – since he is overcome by sleep he is not so desirous of her, and is only having intercourse in order to fulfill the mitzvah or to appease her, but his heart is repulsed by her; this is one of the nine negative sexual attributes mentioned in Nedarim.
If a man is overcome by exhaustion, he may have relations with his wife for no other reason than to fulfill his obligation toward her; this may cause a sense of repulsion, which is a bigger problem from a halakhic perspective than having relations during the day.
The Meiri writes:
Although it is prohibited to have relations at any time except for the night, anyone who feels forced into sleep by his nature at night, and finds it difficult to fulfill his wife's needs, or if she is overtaken by sleep at night and uninterested in sexual relations, he is allowed to have relations in the daytime in privacy according to the rules we explained, so that sexual relations may be through desire and love and not forceful and madness.
The Meiri is not concerned only with the husband's exhaustion, but with the wife's as well. If either one is exhausted at night, they can have relations during the day to ensure "that sexual relations may be through desire and love and not forceful and madness." He does emphasize that this should be done "according to the rules we explained," which are a darkened room, or covering the light with his garment if he is a scholar 2 .
Another sugya in the gemara that addresses this matter is Beitza 22a:
Abba bar Marta asked Abaye: Can the lamp be extinguished for 'another matter' [sexual relations]? Abaye answered, but they can have relations in another room. But what if he does not have a different room? Perhaps he can create a partition. But what if he cannot create a partition? Perhaps he can invert a vessel over the lamp. And if he does not have a vessel, what should he do? Abaye responded: then it is prohibited.
The gemara discusses whether it is permitted to extinguish a light (on Shabbat or chag) in order to have relations in the dark. The gemara concludes that if there is no way to darken the room – the couple is prohibited from having relations.
This is the source for the Rambam's ruling in Hilkhot Issurei Biah 21:10:
A man is forbidden to engage in relations by candlelight. If, on the Sabbath, he did not have another room and there is a light burning, he should not engage in relations at all.
Similarly, it is forbidden for a Jew to engage in relations during the day, for this is brazen conduct. If he is a Torah scholar, who will not be drawn after this, he may create darkness with his garment and engage in relations. One should not, however, adopt this measure unless there is a great need. It is the course of holy conduct to engage in relations in the middle of the night.
The Rambam prohibits relations in a lit room, and explains that "it is the course of holy conduct to engage in relations in the middle of the night."
The Rambam does not relate to exhaustion or a darkened room, and the Maggid Mishneh comments: "Our Rabbi did not mention this, in order to distance one from excessive relations."
As a rule, according to the Rambam one should avoid engaging in sexual relations excessively; he therefore avoided mention of the leniencies in the gemara 3 . The Shulhan Arukh (Orah Haim 240:11) linked the prohibitions to have relations by light and in the daytime, and it seems his position is that the daytime prohibition is only relevant if the woman can be seen:
It is prohibited to have relations by candlelight even if one uses his garment to shade the light. And it is prohibited to have relations during the day, unless the house is dark.
The Shulhan Arukh prohibits having relations in the light, but permits relations in a dark house during the day. However, in Even Haezer 25:5 he writes that relations are prohibited during the day due to impertinence. The Rema in Orah Haim 240:11 comments:
But if one makes a high partition of ten (tefahim) in front of the candle, even if the light can be seen through the partition, such as that he used a sheet, this is permitted. This seems the conclusion from Rashi's analysis in Beitza chapter 2. This is also the case if one covers the candle with a vessel […] and a talmid hakham can use his garment to shade the light.
Rema permits relations with indirect, dim light; the partition need not create total darkness, and a talmid hakham may use his garment to shade the light.
The Rema is generally more permissive with regard to the laws of appropriate sexual conduct than the Shulhan Arukh, and this is apparent in other instances as well.
Like the Rambam, the Shulhan Arukh did not relate to the case of being overcome by sleep, and it appears they both disregard this as a reason to permit daytime relations or relations in the light.
The Magen Avraham and Baer Heitev follow the Rema, who permits relations in dim light, but quote the Rambam who states that a talmid hakham should have daytime relations only in extenuating circumstances. What are extenuating circumstances? The Magen Avraham writes:
This should only be applied for extenuating circumstances, in other words, when he is overcome by the urge […] although it seems in a dark house relations are permitted without extenuating circumstances.
In other words, the Magen Avraham permits relations in a dark house without other conditions; but still states the halakhic preference not to engage in daytime relations.
In summary, most Rishonim do not object to daytime relations, but only to having relations in the light. When engaging in daytime relations, the Shulhan Arukh demanded complete darkness, whereas the Rema permitted relations in dim light.
The Ahronim mentioned a variety of 'extenuating circumstances' in which it is permitted to have relations in the light:
The Mishkan Yisrael prohibited light only during penetration, but not before or after 4 . It is unclear what this division is based on, when in fact the opposite seems more likely. Since the primary reason to prohibit relations in the light is that the husband might find his wife repulsive, it is unclear why foreplay or after-play should differ from penetration. Rabbi Eliezer Melamed reached the same conclusion in his book Simhat ha-Bayit u-Birkato 5 , and R. Maor's Harchavot explains that this should be the prevalent guidance.
While the source of this division is unclear, this seems a logical approach since there is no prohibition to view one's wife naked while she is not niddah, apart from viewing the vagina specifically.
Rabbi Melamed permits daytime relations in other various situations, such as a soldier on leave, or a man who returns from traveling.
According to all halakhic positions, nighttime is the preferred time for sexual relations.
In case of a conflict with having relations at night, such as exhaustion, stress, etc., a couple may have relations during the day in a darkened room.
Complete darkness is not a prerequisite according to most authorities.
The prohibition to have relations in the light is only during penetration; full light is permitted for foreplay or after-play.
Today, since many young couples live under stressful conditions, and are too exhausted at night to give each other proper attention, I believe Rashi's advice should be followed, and time should be found during the day to have relations when the couple is desirous. As the Meiri points out, both husband and wife may be too exhausted to engage in sexual relations.
Nevertheless, we reiterate that there is a preference to have relations at night, and a special blessing that nighttime relations may lead to pregnancy, "the night which said, a boy was conceived" (Job 3:3).
1. A detailed analysis of the nine negative sexual attributes and Rashi's position can be found in Ladaat Leehov, Appendix A, pp. 201-206.
2. Tosfot also permit daytime relations in a dark room; see s.v. שמשמשין מטותיהן.
3. For the contradiction to the Rambam in halakhah 9, see Ladaat Leehov p. 194.
4. Mishkan Yisrael, p. 79.
5. Simhat Habayit u-Birkato, pp. 55-56; see in Harchavot where he explains that this division is not reflected in the poskim.
 עיינו פירוש מופרט על 'בני תשע מידות' ושיטת רש"י בספרי 'לדעת לאהוב', נספח א', עמ' 201-206.
 גם התוספות מתירים ביום בבית אפל, עיינו תוד"ה שם ד"ה שמשמשין מטותיהן.
 איך מסתדרת גישה זו עם מה שהרמב"ם כתב בהלכה הקודמת, הלכה ט', עיינו בנספח הנ"ל בעמוד 194 ומקורו בגמרא בנדרים כ.
 באר הגולה מפנה למקור דברי השו"ע למימרתו של רבי יוחנן בנדה דף טז עמוד ב: "א"ר יוחנן: אסור לאדם שישמש מטתו ביום. (אמר רב המנונא) מאי קרא? שנאמר : יאבד יום אולד בו והלילה אמר הורה גבר, לילה ניתן להריון, ויום לא ניתן להריון. ר"ל אמר מהכא: בוזה דרכיו ימות." רשי"י מפרש כאן את הטעם בגמרא כמו שכתוב בהמשך, שמא ייראה בה ערוות דבר ותתגנה עליו.
 משכן ישראל עמ' ע"ט עיינו שם את יתר הפרטים.
 שמחת הבית וברכתו עמ'55-56 ועיינו בהרחבות שהעיר שבאמת חילוק זה לא נזכר בפוסקים.