Closing a credit card can hurt your credit score, since doing so effects your debt to available credit ratio. For example, if you owe a total credit card debt of $10,000 and your total credit available is $20,000, you are using 50% of your total credit. If you close a credit card with a $5,000 credit limit, you will reduce your credit available to $15,000 and change your ratio to using 66% of your credit. There are caveats to this rule: if the account was opened within the past two years or if you have over six credit cards.
The magic number of credit card accounts to have in order to maximize your score is between 3 and 5 (although having more will not significantly damage your score). For example, if a card was opened within the past two years and you have over six credit cards, you may close that account. If you have more than six department store cards, close the newest accounts. Otherwise, do not close any at all.