I translates the for masculine, plural nouns that begin with a consonant. Those nouns that are preceded by il in the singular take on i in the plural.
Il libro > i libri (the book, the books)
Il gatto > i gatti (the cat, the cats)
Gli also translates the for masculine, plural nouns (those who take on lo or l' in the singular), but it's used for nouns that:
- begin with a vowel
L'amico (lo amico) > gli amici (the friend, the friends)
- begin with s+consonant
Lo spazio > gli spazi (the space, the spaces)
- begin with ps- or pn-
Lo psicologo > gli psicologi (the psychologist, the psychologists)
Lo pneumatico > gli pneumatici (the tire, the tires)
- begin with gn-
Lo gnomo > gli gnomi (the gnome, the gnomes)
- begin with z
Lo zaffiro > gli zaffiri (the sapphire, the sapphires)
- begin with y
Lo yogurt > gli yogurt (the yogurt, the yogurts)
Gli can also be used as a pronoun to translate to him and, in colloquial speech, to them.
Gli do un fiore. I give him/them a flower. I give a flower to him/them.
Li is a only a pronoun and it's used to replace a direct object, more specifically a plural masculine direct object.
Vedo i libri. I see the books. Li vedo. I see them.
Vedo gli alberi. I see the trees. Li vedo. I see them.
Libro e albero are both masculine nouns in Italian.
Hope this helps!