We use when as a conjunction meaning ‘at the time that’. The clause with when is a subordinate clause (sc) and needs a main clause (mc) to complete its meaning. If the when-clause comes before the main clause, we use a comma. More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.