I never imagined it could be so hard to define it until i read this question here. I don't fully agree with Wikipedia or Stack-exchange.
It is simply a short musical phrase. It will usually be in soloing style, high pitched and likely to have one or more guitar techniques that are more typical in guitar solos like a bend and it definitively may have chords, typically triads. It will be played isolated in sections of a song but a guitar solo is made of several different inter connected licks.
All high pitched phrases you hear on the above link that lasts a few seconds are licks, the longer high pitched parts are solos, or inter connected licks. Everything else are riffs or chord progressions. If a lick is repeated in sequence even if with small variations it would likely be classified as a riff.
What if a lick a lower pitched or does not use any soloing technique? That is where the difference is: the lick is always short lived, never repeated in sequence and so never forming any theme. One could argue that a riff is the repetition of a lick as long as it is not made of chords only or mostly chords.
The introduction riff of the song i posted is clearly a guitar lick repeated in sequence and it is low pitched and does not have any typical soloing technique.