A riff is a short section of music, especially in jazz. When you're first learning to play the saxophone, you may just play the same riff over and over.
When one jazz musician in a band is improvising, the others are typically playing riffs in the background. Sometimes a riff introduces the start of a song or its chorus. To play this section is also to riff, and you can also talk about improvised speech using riff: "The stand-up comic decided to riff on the subject of his mom, since it was the only joke that was getting any laughs."