The three-digit code on the back of the credit card is also known as the "CVV2 code" or "verification code." On American Express cards, this verification code is listed on the front of the card, not the back. The three-digit codes aren't magnetized, so they're not scanned when swiped. Merchants aren't permitted to save these three-digit codes.
Credit cards' three-digit codes serve a key purpose: to protect consumers from credit card fraud. When making a purchase in person, merchants take precautions to make sure the person swiping the card is the cardholder by asking for identification. If you make a purchase online or by phone, merchants can't easily verify whether or not the customer is the legitimate cardholder. To protect cardholders against fraud, merchants ask for the three-digit code as a way to verify that the person making the purchase has the card in hand. A criminal who learned your credit card number by combing through your mailbox or peering over your shoulder in line at the grocery store can't easily learn the secret three-digit code, as it appears on the back of the card, doesn't appear on your account information and isn't scanned along with your credit card number at the cash register. A criminal attempting to use your credit card number in an online or telephone transaction can try to guess what your three-digit number is, but incorrect entries will result in the purchase being denied.
Criminals often follow closely on the heels of security innovations with new techniques for perpetuating fraud. In this case, it's possible that consumers might be duped into sharing their three-digit code when contacted by criminals posing as credit card company representatives. Your credit card company already knows your account number, so if they legitimately call you, they won't ask for your account information.
If you receive a phone call from someone masquerading as a credit card company representative who asks for your three-digit code, hang up. Call your credit card company to verify that someone has tried to get in touch; if it was legitimate contact there will be a record of the call and the company representative will explain why they called. Never respond to emails asking for your sensitive credit card information or click on links supposedly directing you to the company website; instead, contact your credit card company directly. Report suspected fraud when it happens; this can help appropriate agencies catch scammers.