It's a bit complicated. In the case of "giocando si impara," Italian grammarians would refer to that as "gerundio". However, that's the kind of thing that English grammarians would call a "participle", and we might translate it as "one playing, learns". If the "-ing" form in English is properly a gerund, then yes, you can reliably use the infinitivo. In fact, you can always do that in English (running is my life→to run is my life). Unfortunately, English speakers also use "-ing" for participles, progressive tenses, and a few other obscure purposes. Until you get more intimately familiar with the use cases, I would stick to this rule: if it's gerund in English, use infinitivo; if it's participle in English, use gerundio.
Participle example: "The cat staring at you is Fuzzy. The one purring is Pickles."
"Il gatto ti fissando si chiama Fuzzy. Quello facendo la fussa si chiama Pickles."
Gerund (NOT GERUNDIO) example: "I took up swimming a year ago and I can't get enough!"
"È un'anno che mi sono dato nuotare, e mi diverta cosí tanto!"
Present progressive: "She can't come to the party. She's studying for a huge chemistry final."
"Non riuscirá ad esserla alla festa. Studia per un'esame enorme di chimica."
Notice I used the indicativo in that last example, not the progressivo, which would be "sta studiando". I would tend towards that unless I'm talking about something that's happening right now to an inanimate object, which is one of the rare times I would use the progressivo. I'm not sure I can explain why, but I will say that progressivo is not used very often in Italian, just as the indicative is not used very often in English.