This is the 37th most frequent Polish word.
gdy
"When" or "as."
'Gdy' is used here in an interrogative form to inquire about someone's actions during a specific condition or situation, analogous to 'when' or 'if'.
Co robisz, gdy pada deszcz?
What do you do when it rains?
In this example, 'gdy' introduces a temporal clause to describe the time of the event in question, functioning like 'when' in English.
Byłem zaskoczony, gdy usłyszałem tę wiadomość.
I was surprised when I heard the news.
Here, 'gdy' is used to introduce a subordinate clause indicating a time frame, serving a similar purpose as 'when' in English.