It is not necessary to close your credit card before applying for a mortgage, but it is a good idea to do so if you have a lot of credit card debt. Lenders will look at your debt-to-income ratio when deciding whether to approve your mortgage application, and having high credit card debt can make it more difficult to get approved.