Sophia It is a very good question, because they seem similar.
AFAIK, a riff is a repeating section inside a song, so repeating that it basically can define the song. A lick happens to be in a song occasionally.
E.g. "Smoke on the water" has this very famous riff, repeating all over the song. Actually, this is the essence of the song itself.
"What'd I Say" from Ray Charles has a lick at 0:26 sec, (Youtube). It belongs to the song but does not define the song in a way like the famous "Smoke on the water" riff does.