That question is hard to answer in general.
I think it depends on your location and what you want do with it.
I have found this link, which is about lyrics quoted in books, but I think you can transfer it to your question:
Quoting Lyrics and Dodging Copyright Issues by Grant Piercy
As suggestet, here are some quotes from the article:
Let me make this perfectly clear. Unless you want to pay royalties to someone else, or you want to limit your print run (self-publishing e-suicide), you probably don’t want to quote lyrics.
The first thing I stumbled upon the search for this topic was the term fair use, because of that, I think this is a very crucial part:
Then there’s this other term that gets thrown around: “fair use.” This is a loophole in copyright law that allows the distribution of copyrighted material for educational purposes only. Don’t fall into the trap of thinking that only a line or two of copyrighted material in your 60,000 word manuscript falls under fair-use, especially if you plan on selling that manuscript.
Then there are other factors that may influence the copyrights:
You can also consider quoting something in the public domain. Almost anything 90 years or older is in the public domain — you’re free to quote it or use it as you will. This is why the field of literary mash-ups (books like Pride and Prejudice and Zombies) has become so popular in recent years. But this is tricky for different countries and different publication dates: see this List of Countries for their copyright length.
And if you really want to publish your work this might be interesting:
If you’re going to even try, the first thing you’ll want to do is check with Hal Leonard, which is the biggest name in music publishing. They have a searchable database and a form that you can fill out that will help you request the rights to the song you want to quote. But prepare to spend at least $100 per song, no matter how much of the song you plan to quote. This also depends on your desired print run and how much you want to charge for each copy of your book. Considering e-book publication is open-ended, or at least you should hope it’s open-ended, you’ll likely be asked to limit the number of copies you can sell. Once you reach this number, you’ll have to re-up with the contract you’re offered. My price-tag would’ve been somewhere north of the $500 mark.