A. Definition of Day
When does a day begin? With regard to all mitzvot in the Torah, except for those associated with the seder korbanot (temple sacrifices), the day begins at night, as it says in the Torah (Bereishit 1:5): "And it was evening and it was morning." Thus, Shabbat officially begins at the onset of night when three medium size stars appear (tzeit ha-kokhavim) at the end of Friday, the sixth day. However, since Chazal were unsure as to when exactly tzeit ha-kokhavim occurs, they legislated that we treat sheki'a - the moment when the ball of the sun disappears over the horizon - as the beginning of Shabbat (OC 261:1).
Although sheki'a is actually the onset of bein ha- shemashot - a time which may be day or night - for the purpose of Shabbat we treat it as nighttime. Thus, all the laws and regulations that are relevant to Shabbat are applicable at this point in time (with the exception of a few leniencies - see below), even if one has not yet accepted Shabbat (OC 261:1). Similarly, one who is unsure if it is bein ha-shemashot yet must act as if it is already bein ha-shemashot (MB 261:1).
Bein ha-shemashot lasts for 3/4 of a mil, after which it is definitely night - what we call tzeit ha- kokhavim (see OC 261:1, and Mishna Berura 261:20). It is important to define precisely how many minutes are represented by 3/4 of a mil, since there are certain leniencies which apply only during bein ha-shemashot. There are essentially three opinions regarding the definition of a mil, and thus three opinions as to the duration of 3/4 of a mil.
1. Beit Yosef (OC 459:2, and YD 9:6, and see also Shakh
ibid. note 25) rules that a mil is 18 minutes; thus 3/4
of mil is 13 and 1/2 minutes.
2. The Rambam (Commentary to Mishna Pesachim 3:2) and
the Bartenura (ibid.) rule that a mil is 24 minutes, and
3/4 of a mil is therefore 18 minutes.
3. Finally, the Vilna Gaon (OC 459) rules that a mil is
22 and 1/2 minutes, and thus 3/4 of a mil is about 17
minutes. The common custom is in accordance with Beit
Yosef - that a mil is 18 minutes, and 3/4 is 13 and 1/2
minutes (MB 261:23).
Thus, for 13 and 1/2 minutes, i.e., during bein ha- shemashot, even though it is forbidden to perform biblical or most rabbinic proscriptions, there are a few leniencies which Chazal permitted, since it is "safek yom safek laila" (literally, there is doubt as to whether it is day or night). [It should be noted that 1) these leniencies are only applicable when the majority of the community has not yet formally accepted Shabbat, and 2) they are valid even though the individual in question has accepted Shabbat and it is already bein ha-shemashot (OC 261:4, and Mishna Berura ibid., note 28).]
The essential principle of these leniencies is that anything which is forbidden mi-derabanan (by the Rabbis) and will not ultimately lead to a violation of an issur Torah (a biblical prohibition), is permitted during bein ha-shemashot, with the caveat that the activity be either for the purpose of a mitzva overet (a mitzva whose time will pass), or for guests, or for the needs of Shabbat, or in order to prevent a great loss of money, or where there is great need (OC 261:1 and 342:1).
Thus, for example, if one forgot to separate terumot u-ma'asrot and there is no other food available, one may separate the tithes at this time, since the activity is necessary for the mitzva of eating on Shabbat (OC 261:1, and Mishna Berura, ibid, note 4). Similarly, if one's only cutlery has not yet undergone required immersion, and there is no other cutlery available, one can immerse it during bein ha-shemashot. One may also, at this time, insulate pots of foods with material that merely keeps the heat from escaping [we will discuss the prohibition of hatmana (insulating) in a later shiur], and establish an eiruv chatzeirot (literally a uniting of courtyards) and an eiruv tavshilin (literally a uniting of foods). [Both eruv chatzerot and eruv tavshilin will be discussed in a later shiur (see OC 261:1).]
An even greater leniency exists with regard to amira le-akum (literally, instruction to gentiles). Even in the event that the entire congregation has accepted Shabbat, one may instruct a non-Jew to perform even a melakha min ha-Torah (a biblically prohibited work) so long as it is not yet almost tzeit ha-kokhavim, and the activity is for the sake of a great need, or for the needs of Shabbat, or for the purpose of a mitzva. Thus, one may instruct a non-Jew, during this time period, to turn on the lights in the dining room so that one may have a pleasant Shabbat meal (OC 261:1, MB261:18; OC 342:1, MB 342:1, and Bi'ur Halakha, s.v. Mutar).