The Mitzvah of Tzitzit is only applicable in the daytime since the verse states “Uritem Oto” (lit. “and you shall see it [the Tzitzit]”) and seeing is considered only possible during the day. On the other hand the Gemara (Menahot 36b) says that the Mitzvah of Tefilin is in the day and at night as well. The reason that Tefilin are not worn at night, however, is because one may fall asleep and pass gas while wearing them and this would be considered disparaging to the Tefilin. As well, by falling asleep one loses the proper concentration that is necessary while donning Tefilin. Thus, even though on a biblical level one may don Tefilin at night, the Rabbis forbade it. It should be noted that this is not considered a full fledged Rabbinic decree (Gzera) such as not blowing the Shofar on Shabbat (lest one carry the Shofar in the public domain) or riding an animal on Shabbat (lest one tear a tree branch to use in directing the animal), but rather a lesser enactment.
One practical application of this Halacha is when Tefilin are worn during Minha of a public fast. Very often, the Minha prayer can extend past sunset while the congregants are still wearing Tefilin. The Shulhan Aruch (O.H. 30:2) writes that it is forbidden to don Tefilin at night, but that if one already had them on and the sun set, one may continue wearing them. Although this is the Halacha, the Shulhan Aruch states that one does not go out of one’s way to teach that Tefilin hypothetically could be worn at night. Practically speaking, however, if one is in the aforementioned scenario, one may wear the Tefilin a little but after sunset until the Minha prayer finishes. The Shulhan Aruch continues and says that if the sun has set and there is no where to safely keep one’s Tefilin, one may wear them until one gets to a place where they may be kept. Nevertheless, the Mishna Berura (O.H. 30:15) and the Ben Ish Hai (Parashat Vayakhel), who both cite the Arizal, say that the Tefilin should not be worn at all after sunset.
Rabbi Moshe Feinstein (Igrot Moshe, vol. I, Orah Haim, § 10) responds to a question from someone who worked for the Russian government from very early in the morning till the night and did not have the opportunity to put on Tefilin. Normally, the time of Tefilin is from the time that there is sufficient light for one to recognize one’s fellow (O.H. ibid:1), roughly six minutes after dawn, till sunset. Regarding one who needs to don Tefilin before dawn, the Shulhan Aruch (O.H. ibid:3) says that one may wear them and when the Halachic time comes, one should shake them and recite the blessing while wearing them. However, the above case involved one who would wear Tefilin and remove them before dawn. Rabbi Moshe Feinstein responds that, as mentioned initially, the prohibition to wear Tefilin is not a Rabbinic decree but rather a prohibition based on a concern of falling asleep. Therefore, he permits wearing and removing the Tefilin before dawn, and to even recite a blessing, especially in light of the fact that in this case, such a person would never have an opportunity to wear Tefilin and may forget about this Mitzvah. If one is learned and is faced with this situation, one should not recite a blessing.
Summary: Tefilin are not worn at night. If one is wearing Tefilin close to sunset, one may keep them on a few minutes after sunset if necessary.