No more than a third of your gross annual income should go towards housing. As for rent, you should not spent anymore than 25% of your gross income.
Housing - This expense should include mortgage, insurance, gas, electricity, maintenance, and phone. Rent or your monthly mortgage payment plus each of the above should never exceed 36%. 1/3 is generally a good rule just as with the 1st answer, but don' t forget that the number includes the other housing expenses.