The bank will look at how much you earn and how much you owe and say "We can pre-approve you for $X at Y%". They consider that you can pay that rate and they are most likely right.
Now if you do take $X, you have effectively leveraged your entire earnings, which for most people is a pretty bad idea because stuff happens and you can end up with a mortgage you can't pay because turns out you also want a car.
That being said (at least in Canada), your broker won't really let you take the full bank offers, or at least they don't expect you to do it.
For a $5,000 mortgage, that's a $5,000 a month buffer
Federal actual rate 16.5% (24% marginal)
CA State actual rate 6.4% (9.3% marginal)
Medicare rate 1.45%
OSDI rate 6.2 %
CA SDI rate 1.0%
Total:31.55% total before tax deductions and tax shelters
If your mortgage is ~40%, you have ~30% left over.
Per month, this is 4,000 for a mortgage, 3,000 taxes, and 3,000 remainder.
A 4,000/month mortgage covers a 800k loan on $1 million dollar home.
You don't get a lot of house in the bay area for 1 million, So if you are single earning this much, you are looking at condos.
If have two similar earners, you just double everything. E.g. 2 million dollar house with $6,000 per month remaining income.
You haven't factored in property taxes, home insurance, or anything. Putting these numbers into a calculator, your monthly loan payment is going to be closer to $5,400 a month.
You're taking home $6,800 a month.
You're not living on $1,400 a month in the Bay Area.
No bank is giving you this loan.