My father passed away when I was seven.

Literal

Father [topic-は] me [subject-が] 7-years [when-のときに] passed-away.

7歳のときに sets the age at the time of the event. 亡くなった is the polite euphemism for dying.