Menachot 36 - When to Put on Tefillin
The latest time to wear tefillin is when the sun sets. Rabbi Yakov says that one may leave the tefillin on until people have stopped walking the streets and no one can longer see him any longer. The Sages say that he may wear it until the time he decides to go to sleep. There a few possibilities to explain this argument: that the Torah prohibited wearing tefillin after sunset, that the Sages prohibited this out of concern for people falling asleep in their tefillin, or that no such prohibitions exist.
The rulings above apply mostly to the earlier times, when people wore tefillin all day. Nowadays they wear the tefillin only during the morning prayer.
Art: Adolph von Menzel- Schlafender - Man Asleep
