Work of Music
"Work of music" is not an especially common English phrase. It is used, but not nearly as frequently as "piece of music."
If you follow this link to the ngram, you'll see that "piece of music" was 32 times more common in published works in 2019.
Of the handful of examples of "work of music" that I scanned through, a significant portion (maybe a majority) were found in philosophical discussions of music or art.
Unless you are discussing the nature of music, or of art, I would suggest avoiding the phrase "work of music"1 - clearly some people use it, but some people will find it strange, whereas virtually everyone will find "piece of music" normal.
Piece of Music
Piece of music is a very general term. Music is a mass noun in English, so if you want to speak of a single unit of music, you have to use piece. This is just the same as with other mass nouns: you can't say a music, just as you can't say a software, an advice, a clothing (it's piece of software, piece of advice, piece/article of clothing). So anything that you would refer to as music can be a piece of music: the so-called "Symphony of a Thousand [musicians]" or a melody you hum.
An important note: a piece of music can be referred to as "a piece" - as in, "the orchestra played one piece that was forty-five minutes long." We also use piece in this way when speaking about other works of art (i.e. you can call a dance composition or a work of visual art "a piece"), but we would not say, "I have a lot of software installed on this computer - Firefox is my favorite piece" and probably would not say "She gave me a lot of advice - one piece was especially useful..."
Be careful, though, a piece of pop music would probably not be referred to as "a piece." When listening to a Beethoven album, "This is my favorite piece" will definitely be acceptable; when listening to a Miles Davis album "This is my favorite piece" will probably be acceptable; when listening to an NWA album, "This is my favorite piece" will sound pretty strange.
As another answer points out, not everything that is sung is properly called a song. And on the other hand, pieces of music without words are often called songs. For example, the iTunes store has a section called "Top Songs." It's likely that all ten of those compositions do have words, but if a piece without lyrics sneaked onto the list, they wouldn't feel the need to change the section heading to "Top Tracks."
Again, the context is important. You're more likely to hear song used to refer to an instrumental piece of pop music than a classical composition without lyrics.
- On the other hand, it is common to refer to certain musical compositions as "works." For example, we might speak of "the works of Mozart" or "the works of Beethoven," or we might regard one of Mozart's compositions as "a work of great beauty and power." Calling a composition "a work" suggests a fair amount of gravitas. We would probably not refer to a television jingle "a work" and we're more likely to write of "the works of Mozart" than "the works of Madonna."