How is a mortgage quote calculated?

In uk how do they work out how high a mortgage u can have?
Answer
Yeah - generally 3 times your salary (although you can borrow 4 or 5 times depending on your circumstances, lender etc.)also how much you have as an initial deposit and any other assets you own (other property, million in the bank, etc.)