This is the 11129th most frequent Turkish word.
duydu
"He/she/it heard."
'Duyduğunda' combines 'duydu' with a temporal clause, denoting the time when the person received the news.
O, arkadaşından haberleri duyduğunda çok şaşırdı.
He was very surprised when he heard the news from his friend.
Here, 'duydu' is the past tense of 'to hear' and indicates Ali listened to and perceived the sound of someone singing.
Ali bir düğünde şarkı söyleyen birini duydu.
Ali heard someone singing at a wedding.
In this case, 'duyduğum' is derived from 'duydu' and signifies the act of hearing a joke incidentally.