The bane of so many impulse buyers, your credit score is not something you want to undervalue when you're thinking of purchasing a home. It should be one of the first considerations on your list, to be addressed well before you take a step into a bank or broker's office, because it affects the kind of mortgage they'll offer you.
Your credit score is a compilation of your entire credit history, pretty much every purchase, payment, loan, past-due balance, default or bankruptcy in your adult life. The better your credit behavior -- paying off credit card balances on time, having open credit appropriate to your income, making loan payments promptly -- all of it counts.
Scores range from 300 to 850. Very few people can manage an 850, which is perfect credit. Don't worry about perfection here, since anything above 720 is considered "excellent" and will win you the best mortgage rates available. If your score is above 720, you can check this one off your list.
"Good" credit (680-719) will also get you fine mortgage terms. "Average" (620-679), on the other hand, might require a bit more work. While it doesn't rule out a decent mortgage, it does require some extra attention to figure out if it's in your best interest to accept the terms: They may leave a bad taste in your mouth.
If your credit score is "Poor" (580-619), you can still get a mortgage, but you'll be paying a lot more in interest -- basically whatever the bank wants you to pay, since they consider you a risk. Being at the mercy of the bank is not a particularly smart way to go.
Below 580, and your best move, in fact your only move if you want to score even remotely fair terms on your loan, is to wait. Focus on raising your credit score through smart decisions and taking action to aid the process. It may take a while, but the difference in your mortgage terms will be dramatic.
Next, the big money drop ...