A card or personalised note is appropriate whether you've known your boss for a short or long time. It goes a step beyond a generic card, especially if you have a good relationship with your boss or if you can't find the right card. You may include words that are based on your relationship or history. The wording should be professional and may be customised for where the boss is going, such as another job, out-of-state, retiring or the specific situation.
Congratulate your boss on his retirement, promotion, or new job. If your boss is leaving because the company was downsizing, try to focus on the positives instead, letting him know you believe he'll be successful wherever he goes.
Let your boss know that you appreciate her leadership/direction, wisdom and vision while she was with the company. If she mentored you along the way, thank her for mentoring and motivating you.
Ask him to stay in touch, depending on your relationship, and that you'll miss his guidance.
Be sincere, but thoughtful if you don't have a good relationship with your boss. You can focus on your boss's strengths as you word the card. If you're at a loss for words, jot down your thoughts on a separate sheet of paper and read them aloud before writing the card. You may keep the card short and to the point.