1. If in the question it is given it is a branch instruction and the branch prediction technique gives correct output, then branch penalty=0;
2. If it is given that branch instruction cannot start until the current execution, then it will start after WB stage and so number of stalls=branch penalty will be 4(IF of next instruction will start after WB of the branch instruction).
3.If it is given it will start after M then branch penalty will be 3(IF of next instruction will start after M of the branch instruction).
Hope this clears your doubt.I almost cover all the cases.