It is the time of day in the evening when the sun is not visible in the sky, but it is not yet night. Very similar to dusk, but emphasizes the quality of daylight at that time. I am not sure of the origin of this word, though.
Twilight is that time in the morning or more usually the evening when the sun is not visible but there is still light which is being reflected back down from the sky above by the sun below the horizon.
I notice this particularly in Ireland as opposed to when I am in parts of the USA, the amount of twilight depends on what latitude you are at and the time of the year.
It is a nice soft time of the evening when the harshness is reduced, almost like being in an old house with a candle. It is an interesting thing to experience if you happen to live at a latitude where it does not occur.
In general, most of the people who have already answered your question are, in my opinion, correct. The term is usually used for that period between sunset and night. There are a few of us, however, who also use term for that period between night and sunrise. At least many waterfowl hunters do so.
The prefix "twi" does refer to between or twixt. Thus twilight can (emphasize "can") refer to that period between dark and light.