To assess whether or not you can afford a mortgage, lenders will look in detail at things like your salary, any other income you receive. Plus, they will also need to know about any other outgoings such as car loans, credit card debt, personal loans, utility bills, childcare, general living costs. All this is taken into consideration when applying for a mortgage.
Also, be aware that lenders will look at your credit score too. They need to be confident that you can pay back your mortgage and that you pay back any other credit, essentially to make sure that you are a reliable borrower.