It applies to insured mortgages and to uninsured mortgages at federally regulated banks. In practice it lowers the maximum you can borrow: on the same income you qualify for less than the actual payment would suggest.
Lenders compute two ratios at the qualifying rate: GDS (housing costs over income) and TDS (all debts over income). Paying down consumer debt before applying usually improves the result more than a slightly lower rate would.