http://www.quickanddirtytips.com/education/grammar/if-versus-whether <- This is my favorite (but lengthy) explanation.
Basically, in an informal setting they can normally be used interchangeably, but there is a rule for formal use. If is for conditionals, and whether is for two possible options.