She went along when her mother went to buy shoes.

Literal

She [topic-は] mother [subject-が] shoes [object-を] buy time [to-に] tagged-along.

付いて行く ('to follow along, tag along') is a compound using 付く + 行く. 時に marks the temporal occasion.