We use whether when there is more than one possible answer to the question.
We use if with conditional sentences.
"If I smoke, I might get lung cancer."
"I was diagnosed with lung cancer and the first thing the doctor asked me was whether or not I had ever been a smoker."
You can use either formulation for a yes/no question.