Playing cards appear to have originated in China and migrated west via the Near East, but much of their noteworthy history is in Europe. (Cards in China have mostly developed into gaming tiles, the history of which will be the subject of another post sometime.) Beginning in the late 14th century, printed cards have been mass-produced cheaply and used in a large number of games, especially of the trick-taking type. (The form of a standard European deck of cards closely follows this particular function.)
The earliest European decks of cards seem to have had almost precisely the same format as we're accustomed to today: three face cards and the numbers 1-10 in each of four suits, for a total of 52 cards. These, however, typically followed the custom of what are now called "Spanish-suited" cards, where the suits are clubs (in the sense of big sticks for beating people with, rather than the stylized cloverleaf shape seen today), coins, cups, and swords. The face cards were the page or knave, the knight, and the king.
From there, however, there have been a lot of changes. In the early modern period, typical Spanish cards came to have one fewer pip card per suit, leading to the numbers 10, 11, and 12 being associated with the three face cards. Most games which use them further reduce the size of the deck, discarding the 9 and often the 8 from each suit, so that there are numerical cards marked 1-7 and then face cards marked 10-12. Some traditions have gone in the opposite direction, with the Italians introducing the "trionfi" to the deck in the early fifteenth century.
The trionfi were a clever addition: most games in that era were trick-taking games with a designated trump suit chosen for each hand, and in many of them the trumps had a different number of cards included than other suits (accomplished by stealing cards into trump from other suits; for example, in some games the aces of clubs and swords are always the highest two trumps regardless of what suit is selected). Trionfi, the Italian word for "triumphs" (the English word "trump" is a contraction of our cognate term), were an additional series of cards that are not considered to have a suit; the intent was to play games in which those were always the trumps. (These games came to be known as "tarocco" or "tarocchi", a term which came to apply to the special deck as well. The spread of these games into the rest of Europe gave rise to the French term "tarot," by which such cards are now referred in English. However, they appear to have been confined to the Italian peninsula until at least 1500 and possibly later.)
Early tarocco decks had very variable numbers of trumps, though at some point the practice of adding an additional court card to each suit (a queen, ranked between the knight and the king) and trumps numbered up to somewhere in the twenties became typical. The trumps were also even more decorated than the other cards, with pictures (often allegorical) on each and eventually names; one standardized list of twenty-two trumps, along with similarly symbolic imagery on all the other cards, was settled on in the 19th century and gives us the basic form of tarot deck most commonly sold today.
By 1500, Germany had altered the suits of the cards. replacing cups with hearts, coins with (round) bells, and clubs and swords with acorns and leaves, respectively. Some fifteenth-century German decks also have two of the kings (typically the hearts and bells) replaced with queens. It's clear that the modern French suits (also now called "International" suits, as the typical French deck has become the standard for all games save certain regional types) are based on these, but with some influence from the names of the Italian suits. The "club" takes its English name from the Spanish suit, but its shape from the French, where it is probably originally a stylized acorn but has become a trefoil. The diamond is a French replacement of the coin (in French they're identified as carreaux, "tiles"), the heart is obviously the German suit, and the spade (deriving the English word most likely from the Spanish or Italian for "sword") is still given a martial name, but has a shape that closely matches that of the former German leaves and has little in common with any weapon. (In French it's a pique, "pike", the sharp head of which at least bears a distant resemblance to the suit symbol.) France also initiated the custom of using the knave, the queen, and the king for the three face cards. (The English word "knave" would not be replaced with "jack" until the nineteenth century.)
Customarily, Italian and Spanish games refer to the clubs and swords as "long suits" because of their elongated suit symbols, and cups and coins as "round suits". This distinction is relevant to the rules in some games, and is therefore mirrored by the color of the French cards. By printing each card in a single color only (with more later added for the face cards), they could be manufactured cheaply while still indicating this feature.
There is a persistent urban legend that each of the face cards in the deck represents a specific person. This actually has some truth to it - although the faces on a modern pack are generally not intended as portraits, at various points in time many playing card manufacturers have chosen individuals to depict on their playing cards. This was especially common in Paris, and the French did standardize a list for a while. In the nineteenth century, the clubs were typically said to represent Sir Lancelot, "Argine" (just an anagram of Latin regina "queen"), and Alexander the Great, the diamonds Hector, the Biblical Rachel, and Julius Caesar, the hearts were Lahire (a companion of Joan of Arc), the Biblical Judith, and Charlemagne, and the spades Ogier the Dane, Pallas Athena, and the Biblical David. This schema cannot be assumed to hold for any particular deck of cards, though it is valid for most decks from 19th-century France. Earlier French decks tended to have local or legendary kings and queens, but there is no consistency between them.
Of course, the games played with a deck of cards vary across time - but that is a subject for a future post.