as a conjunction (connecting two clauses): When he saw me, he waved.
as a question adverb (introducing a direct or indirect question): When shall we meet? ♦ Do you know when these houses were built?
as a relative adverb (referring back to a noun and introducing a relative clause): I remember the day when the war began. (introducing a clause that is the subject, object, or complement of another clause): ♦ My proudest moment was when I received the poetry prize.