Only under certain circumstances. For example, if you are buying tobacco, alcohol or certain medications, you may be required to show a state-issued ID. Also, if the back of the card is not signed or if the signature on the card and your signature on the receipt do not match, merchants typically will ask for ID. However, the policy of both Visa and MasterCard is that merchants cannot require you to show ID as a condition of using your card. Other card issuers have similar policies. Call the number on the back of your card to report a merchant violation.
Requiring additional identification as a condition of a credit card sale is illegal in some states.