How long to keep credit cards?

I have been told it's not good to pay off a credit card and then close it after paying off my balance for atleast a year? Just wondering if anyone has heard of that? I have a home depot and a zales both are paid off now. Should I keep them open for a little longer?