Quick answer
Е́сли = if, a condition. Ли = whether, inside a reported question. Я не зна́ю, придёт ли он.
Condition: е́сли
A real future condition uses the future in both halves — Russian does not keep the present after е́сли the way English does: Е́сли бу́дет вре́мя, literally “if there will be time”.
Whether: ли
Ли turns a question into a clause. It goes in second position, right after the word being questioned, which moves to the front: Придёт ли он? → Я не зна́ю, придёт ли он.
The hypothetical: е́сли бы
For something unreal, е́сли бы plus the past in both halves: Е́сли бы я был бога́т, я бы купи́л дом. There is no separate past and present hypothetical — one form covers both, and the context decides.
The comma before ли
A ли clause always follows a comma, and never starts with ли. English speakers tend to write Я не зна́ю ли он придёт — the ли has to come after the verb.
Typical mistakes
Я не зна́ю, е́сли он придёт.
Я не зна́ю, придёт ли он.
“Whether” is ли, not е́сли.
Е́сли я бу́ду име́ть вре́мя
Е́сли бу́дет вре́мя
Russian says “if there will be time”.
Check yourself
Which is correct?