This is the 8805th most frequent Russian word.
польского
"Polish" (related to Poland or the Polish language).
In this sentence, "польского" is the genitive singular form of the adjective "польский" (Polish), agreeing with "языка" to describe the language being learned.
Я учу польского языка.
I am learning Polish language.
Here, "польского" agrees with "происхождения" as an adjective, describing the origin of the souvenir.
Он подарил мне польского происхождения сувенир.
He gave me a souvenir of Polish origin.
In this context, "польского" agrees with "друга" in case, number, and gender, describing the friend as Polish.