In opera, the libretto is the words or lyrics, as distinct from the music. Mozart composed the music to his operas, but the librettos were written by someone else.
The life of the librettist is often a thankless one. If the opera is a success, nobody mentions the libretto. Often, the libretto of an opera or musical is called the "book" and refers to all the parts of the script except the music. This can be helpful in remembering what the word means, because libr- is Latin for "book" (as in "library").