*As an Amazon Associate I earn from qualifying purchases.
- If one is already wearing Tefillin, may he continue to wear them past sunset and nightfall?
Past Sunset:[1] If one was wearing Tefillin prior to sunset he does not need to remove the Tefillin when sunset arrives.
Past Tzeis Hakochavim:[2] If one was wearing Tefillin prior to nightfall [i.e. Tzeis Hakochavim], then when nightfall arrives he is to remove his Tefillin if he is in a public area.[3] If, however, one is in private, in an area without any other people, he does not need to remove the Tefillin even after nightfall. Likewise, if one is in a Beis Midrash, even if there are other people around, he may continue wearing them after nightfall.[4]
Wearing past Tzeis Hakochavim in order to guard the Tefillin:[5] If one did not remove his Tefillin prior to Tzeis Hakochavim because he did not have an area to guard them [from being stolen or vandalized, and he is thus wearing them in order to guard them, then it is permitted to remain wearing them, and so is the practical directive. (Nevertheless, one is required to tell the onlookers that he is doing so in order to guard the Tefillin.[6]) It is however forbidden to initially put on the Tefillin at night in order to guard them. (In addition, the initial directive given is that one should not place the Tefillin on even before nighttime in order to wear them into the night and guard them, even though this is permitted from the letter of the law.[7])
Erev Shabbos and Erev Yom Tov:[8] On Erev Shabbos and Erev Yom Tov one must remove the Tefillin prior to sunset, sometime prior to candle lighting on Erev Shabbos.
[1] Siddur Admur [letter 19 Raskin]; Admur 29:1; Admur 30:1-2 and 4 implies that even initially one may put on the Tefillin after sunset, prior to nightfall, as brought in the previous in Halacha B!; Ateres Zekeinim 30:2
Other opinions: According to Kabbalah, one is to remove his Tefillin prior to sunset, and so was the custom of the Arizal. [Yad Ahron in Hagahos Tur; Birkeiy Yosef 30:2; Shalmei Tzibur p. 9; Siddur Beis Oved; Shaareiy Teshuvah 30:3; Yifei Laleiv 30:2; Kaf Hachaim 18:11-12; 30:5 and 7]
[2] Admur 30:2; 29:1; Michaber 30:2 that Halacha Vein Morim Kein; see Menachos 36b
[3] Admur ibid; M”A 30:3 in explanation of Michaber ibid
The reason: From the letter of the law, it is only forbidden to put on the Tefillin at night, however if one had them on prior to nightfall [Tzeis Hakochavim] he may continue wearing them past nightfall, and may remain wearing them for even the entire night. Nevertheless, practically we do not rule this way [Halacha Vein Morin Kein] due to worry that one may come to initially wear the Tefillin at night. Thus, one may not continue wearing them in the presence of other people, so people don’t come to think it is permitted to wear Tefillin at night. [Admur ibid]
[4] Admur ibid; Taz 30:6
The reason: As in a Beis Midrash the people are knowledgeable and aware that you cannot initially put Tefillin on at night, and hence they will not come to make a mistake. [Admur ibid]
[5] Admur ibid; Michaber ibid; Rebbe Eliezer Menachos 36b
A traveler wearing Tefillin past nightfall: One who is traveling [by foot] and does not desire to remove his Tefillin lest they fall, he may continue to wear them past nightfall, until he arrives home. Nevertheless, he is to cover the Tefillin. [Admur 30:4; Michaber 30:4; Beitza 15a]
[6] Admur ibid in parentheses; M”A 30:4
[7] Admur ibid; Taz 30:4
[8] Siddur Admur [letter 19 Raskin]; Admur 30:4; Admur 29:1 “When removing the Tefillin on Erev Shabbos by Bein Hashmashos, when one is obligated to remove them]”

Other opinions: Please see http://www.dailyhalacha.com/displayRead.asp?readID=1520 that according to Chacham O. Yosef zt”l one may recite a blessing on tefillin until 18 minutes past sunset.
However, the Rambam in Hilchos Tefillin, Chapter 4, Halacha 11 says explicitly that a person who puts on tefillin after sunset transgresses a Scriptural prohibition.
It appears to me, in my humble opinion, that one who did not wear tefillin the entire day and the sun has already set is to wear them up until 72 minutes past sunset, as according to Rabbeinu Tam and the SA it is still day [or possibly day] until that time. Vetzarich Iyun gadol if one may be lenient to wear tefillin past sunset [even a moment past sunset] on Friday or erev Yom Tov if he did not wear them before. It appears logical one may not, and so paskened to me HaRav Shlomo Miller, a Litvishe posek in Toronto. But many are lenient to daven Mincha past sunset on Friday, in particular Chassidim who follow the opinion of Rabbeinu Tam, and one may transgress a shvus during bein hashemashos. Tzarich iyun.