What lenders look at
Lenders compare your monthly debts with your gross monthly income. Two common guidelines are that housing costs stay under about 28% of gross income and total debts stay under about 36%. These are guidelines, not laws, and different lenders and loan programs use different limits.
Costs beyond the payment
Owning a home costs more than the mortgage. Property tax, insurance, maintenance, utilities and any HOA fees all add up, and you also need cash for closing costs and moving. A common habit is to set aside money each year for repairs, since older homes need more.
The maximum is not the target
The most a lender will approve is not always what is comfortable. Compare the monthly cost with your own budget, including savings and other goals. A smaller loan leaves room for a rate that is higher than you hoped, or a change in income.
Try different scenarios
Use the affordability calculator with a few interest rates and down payments. Then use the rent vs buy calculator to compare the real cost of owning with renting for the time you expect to stay.