We call someone a "card” when they're especially funny or clever. However, that particular meaning of "card" comes from a much longer history of using the word to describe people with particular qualities.
Beginning in the 1500s, figurative uses of "card" grew out of card games. A “leading card,” for example, was the card used to start a round, and eventually came to refer to a strong point or advantage.
Fast forward to the 1830s, and "card" could describe someone who embodied a particular quality. You could be a “knowing card” or, more positively, a “sure card," i.e., someone you could depend on.
By the 1850s, "card" was also being used for someone who was clever or ingenious, and eventually for someone who was funny, eccentric or a bit of a character. That's the sense behind saying someone “is a card.”
There are plenty of other expressions built around the language of card games. “Trump card” dates to the 1820s, with "trump" being a shortened form of "triumph." And “playing the ___ card” emerged in the late 1800s as a way of introducing a topic in hopes of gaining sympathy or a political advantage.
Over time, that expanded into disparaging expressions such as “playing the gender card” and “playing the race card.”
To hear more about the "cards" our language holds and why someone who's a "card" might also be a "character," listen to the audio above.