When means “at what time.” As a question word it asks about time; as a joining word it means “at the time that.” When did you leave? asks for the moment. Call me when the bus comes points to that moment.
As a joining word, when pins an action to a moment. We'll go when you're ready means your going happens at that time, not before.
It also works in reported questions, where the question sits inside a sentence. She asked me when I would be ready turns the question about time into a statement.
When is your birthday? is asking for the day and month, which is exactly the kind of answer the question wants. Use when to ask about a moment, the way you might ask When did he leave? and expect a time in reply.
It also joins two actions. Here it means at the time that: Turn off the light when you leave says to switch it off at that exact moment, not before.
A nearby word to keep apart: where asks about a place, not a time. Where do you live? wants a street or city, while When do you leave? wants a moment.