There are variables based on state laws and lender peculiarities. In PA, in a purchase transaction, you would not be required to sign anything unless the lender does not understand PA state law.
That changes if you intend to take an ownership interest in the property, whether you are a spouse or not. In cases in which a lender agrees to a non-borrowing co-owner, in PA, that person will be expected to sign the mortgage to create a valid lien.
So, if your name goes on the deed, expect to sign a mortgage at minimum. Most lenders will also have you sign the TIL disclosure (truth in lending).
If the transaction is a refinance and you are a non-borrowing spouse, expect to sign the mortgage and the right to cancel form.
Signing a mortgage is not the same as signing the note. You are not borrowing the money. You are simply allowing a lien on property in which you have an interest.
In PA spouses have potential marital rights. Lenders will want a lien position that is superior to those rights.
If you are a title agent, make sure you add language to the mortgage which clarifies the purpose of the signature of the non-borrowing party. I do this on the description rider.