Rule of thumb: Use as few branches as possible, and as many branches as necessary.
If a branch is necessary or not is something you mostly learn from experience, but when in doubt: don't branch. You need branches when you need to modify the same code at the same time in 2 different ways.