She bought that camera while she was in Japan.

Literal

She [topic-は] Japan [in-に] was [time-時に] that camera [object-を] bought.

~時に ('when, at the time when ~') attaches a time-clause to the main predicate. ~時 alone marks the time, but adding に specifies the temporal point. The clause 日本にいた is a relative-clause-style modifier of 時. カメラ is a katakana loanword.