Before lenders decide to lend you money, they must know that you are willing and able to repay that loan. To figure out your ability to pay back the loan, they look at your debt-to-income ratio. To assess your willingness to repay, they use your credit score.
The most widely used credit scores are called FICO scores, which were developed by Fair Isaac & Company, Inc. The FICO score ranges from 350 (high risk) to 850 (low risk). We've written more on FICO here.
Your credit score is a direct result of your repayment history. They don't consider income or personal characteristics. Fair Isaac invented FICO specifically to exclude demographic factors like these. Credit scoring was developed as a way to consider solely that which was relevant to a borrower's likelihood to repay a loan.
Your current debt load, past late payments, length of your credit history, and other factors are considered. Your score comes from both the good and the bad of your credit report. Late payments count against you, but a record of paying on time will improve your score.
Your credit report should contain at least one account which has been open for six months or more, and at least one account that has been updated in the past six months for you to get a credit score. This history ensures that there is enough information in your report to assign an accurate score. Should you not meet the criteria for getting a credit score, you may need to establish your credit history prior to applying for a mortgage loan.