While they are almost interchangeable, there are indeed subtle differences:
'Whether' supports the conjunction 'or' for choice while 'if' traditionally does not, so although the sentences often seem to have the same meaning, you should use 'if' where the sentence is conditional and 'whether' where it presents two possibilities.
Tell me if you'll be in town at the weekend. - Here, you only need to notify the speaker if you do decide to go to town. "I will be in town at the weekend."
Tell me whether you'll be in town at the weekend (or not). - Here, whatever you choose to do at the weekend, you should tell the speaker. "I will/won't be in town at the weekend" (I prefer to include the 'or not', though some choose to elide.)
Also, a more modern answer might be that 'whether' is considered more formal, though I fear this may be in the same way 'whom' is considered by some more formal.
Hope that helps.