However, different lenders have different criteria. As Julie correctly notes, so long as one person has the credit and income necessary to qualify for the loan, that's generally sufficient. However--and I'm not a lawyer and this varies from state to state--if you're married to the other person (or possibly a "legal partner") the lender may require both of you to be on the mortgage. After all, if the one with the good credit is legally responsible for any debts you may incur, then your actions could result in the other person being obligated for your debts, and thus be unable to pay the mortgage as agreed to. You should check with someone familiar with Pennsylvania law and lending policies.
Hope that helps.