From Polyglot Club WIKI
The difference between "gli" and "li" depends on the function of these two words in the sentense.
Both "gli" and "li" are used only for masculine.
It is used as a pronoun in the construction of the direct object when it is masculine plural.
For the masculine singular we use "lo". For the feminine singular we use "la", for the feminine plural "le" and for the masculine plural, we use "li".
- Hai visto i film di Fellini? Sì, li vedo sempre con grande piacere.
Have you seen the Fellini movies? Yes, I always watch them with great pleasure.
It is used as a pronoun in the construction of the complement for a masculine singular. For the feminine singular, we use "le". For the plural, we use "a loro", and it is invariable in gender.
- Giuseppe ha freddo. Non gli hai dato la tua giacca ?
Joseph is cold. Didn't you give him your jacket?