It’s the old rule of 3’s. You can afford a house that costs no more than THREE times your yearly salary. You can only afford 30% of your take home pay for mortgage.
Of course now with the TAXES (Obamacare, etc)being levied on the middle class, might need to lower that down to the rule of 2. Two times yearly salary for dwelling. 20% of your take home pay for dwelling. Of course soon they will do away with the Home Mortgage Credit.