When she saw me, she bowed politely.

Literal

She [topic-は] me [object-を] sees [when-と], politely bow [object-を] did.

丁寧に is the adverbial form of the な-adjective 丁寧 ('polite, careful, conscientious'). おじぎをする is the standard light-verb construction for 'to bow' — おじぎ (御辞儀) is the noun for a bow. Bowing in Japan is calibrated: a brief 会釈 (eshaku, ~15° nod) for casual greetings, 敬礼 (~30° bow) for ordinary politeness, and 最敬礼 (~45° bow) for deep respect or apology. 丁寧に signals a bow done with genuine attentiveness and care rather than perfunctorily — a thoughtful, well-executed gesture rather than a hurried one.