The answer is different for if you are buying or refinancing
Buying a home.
You can cancel your mortgage loan up until the day you sign. Whether you are pre-approved, approved, have a Loan Estimate, or signed an intent to proceed, you can cancel your mortgage loan for whatever the reason. You are never locked into one lender until the day you sign at closing. Keep in mind though, that the later you wait to change lenders or cancel your loan, the more money you may risk to lose. This is because as the loan process continues certain fees are required. For example, the purchase of an appraisal is often needed to be made prior to obtaining financing. You also can risk losing your earnest deposit if you break a contract between you and the seller.
If an appraisal has already been done, and you switch to a different lender, you may need to pay for another appraisal. This of course could not be a big deal in the great scheme of things. Especially when the appraisal fee is $500 but you get a lower interest rate with the other lender saving you thousands. Losing your earnest money is not always the end of the world if you decide to back out from a particular house. Better to lose a few thousand than to make a several hundred thousand dollar mistake. In order to cancel your pending mortgage you can simply inform the lender verbally. Of course, being unresponsive to the lender will also cancel the transaction.
Refinancing a home
Some may be surprised to find out that you can cancel your refinance after you have signed on the dotted line. In fact, you have until midnight of the third business day after signing to rescind (cancel) the mortgage contract. The three-day clock does not start ticking until these three events have happened:
1) You sign the credit contract (usually known as the Promissory Note)
2) You receive a Truth in Lending disclosure (in most circumstances, this will be your Closing Disclosure form)
3) You receive two copies of a notice explaining your right to rescind
You should note, that in this case business days include Saturdays, but not Sundays or legal public holidays. To cancel your refinance you can use the form your lender gave you or write a letter. Make sure the form or letter it is mailed or delivered before midnight of the third business day. It is a good idea to keep a copy and any evidence that it was mailed or delivered on time.
What is they never gave me those documents
If you did not receive your Truth in Lending disclosure or the notice of your right to rescind, or if they were incorrect, you may be able to rescind your loan up to three years from the date of closing. If this is the case consulting an attorney would be the best first course of action.