I had wanted a game console for a long time when I was at elementary school.
"小学生の時ずっとゲーム機が欲しかった"
小学生の時 when I was at elementary school
ゲーム機 a game console
ずっと欲しかった had wanted ~ for a long time
現在であれば現在完了形を使うのですが、ここでは小学生の時と過去の表現になるので、過去完了を使います。
I had wanted a game console for a long time when I was at elementary school.