expression, noun
free time; spare time; idle moment
A common phrase meaning 'when one is free' or 'in one's spare time'. Functions as a noun or adverbial phrase.
暇なときに映画を見ます。
I watch movies in my free time.
暇なときはいつも本を読んでいる。
I'm always reading a book when I have spare time.
暇 is the noun/adjective meaning 'free time' or 'not busy'. 暇なとき is a specific phrase meaning 'when free'.
Phrase composed of 暇 (free time) + な (attributive form of the auxiliary verb だ) + とき (time).