V-plain / い-adj / な-adj + な / N + の + 時
when ~
The verb form before 時 sets the timing relative to the main clause, not to now. 日本へ行く時 is before or during the trip (buying a suitcase); 日本へ行った時 is after arriving (something that happened there).
子供の時、よく川で遊びました。
こどもの とき、よく かわで あそびました。
When I was a child, I often played in the river.
日本へ行った時、着物を買いました。
にほんへ いった とき、きものを かいました。
When I went to Japan, I bought a kimono.