According to CNN Money:
You need to determine how much house you can afford. You can start with one of the Web’s many calculators. For a more accurate figure, ask to be pre-approved by a lender, who will look at your income, debt and credit to determine the kind of loan that’s in your league.
The rule of thumb here is to aim for a home that costs about two-and-a-half times your gross annual salary. If you have significant credit card debt or other financial obligations like alimony or even an expensive hobby, then you may need to set your sights lower.
Another rule of thumb: All your monthly home payments should not exceed 36% of your gross monthly income.
The size of your down payment will also determine how much you can afford.