My understanding is that it means "whether" in some contexts, but can mean "if" in others. What is the difference in usage?
And what might be the difference between ли and Если, assuming that they both can mean "if?"
if has two meanings. One meaning is the most common one, the one that suggests a condition. This meaning is rendered into Russian as если:
If it rains, we'll stay home.
Если пойдет дождь, мы останемся дома.
The other meaning of if is whether. This meaning is rendered into Russian as ли:
I don't know if it will rain.
Я не знаю, пойдет ли дождь.
Ли is also used to emphasize a question:
Он придет? Will he come? Simple question
Придет ли он? Will he come? More emphatic. Implies that this is a very important question or can also imply that there's certain doubt that he will come.
Ли is sometimes contracted to ль, but this usage is rare in Modern Russian.
Все так же ль осеняют своды
Сей храм парнасских трех цариц?
Все те же ль клики юных жриц?
Все те же ль вьются хороводы?.. (Пушкин)
When ли is used, the natural subject-verb order is usualy inverted (see the examples above).
I would like to add that the first usage of ли (as in "Придет ли он?") is also often found in compound sentences and not just questions. This is pretty much the whether version of its usage. For example:
Я не знаю, пойдет ли дождь. (I don't know whether it will rain.)
Finally, it can be used with a maybe meaning:
То ли дождь, то ли снег. (Maybe rain, maybe snow.)
"Ли" can mean "whether" in some cases, for example:
Whether rain or snow
Дождь ли, снег ли
Which can be shortened to
Дождь ли, снег
However, that form is more poetic than what is usually called for. The following is much more natural
Дождь или снег
Дождь ли, снег ли
can be shortened like this. At least not in an FAQ-style answer.