The time just after sunset, when the light is half-faded, but the world is not yet totally dark, is twilight. If you are between two states, like asleep and awake, that can also be called a twilight moment.
Twilight comes just before the night falls. The early light, just before sunrise, is also technically called "twilight" but most people call it "dawn." The prefix twi- might be a clue that twilight happens twice a day, or it could mean "half," as in the half-light of this time. Something that is declining can be described as twilight — like the twilight of the trend of wearing plastic clogs favored by nurses and chefs.