〜とき、〜 — "when"
V (dict./ない/た)・A-い・A-な[な]・N の + とき、S
とき turns a clause into a time frame: 図書館で 本を 借りるとき、カードが 要ります. Before とき the verb takes the plain form; -な adjectives keep な and nouns take の.
Examples
眠いとき、コーヒーを 飲みます。
When I'm sleepy, I drink coffee.
暇なとき、うちへ 遊びに 来ませんか。
When you're free, why don't you come over?