Tarot came to Europe about the same time as any other
form of playing card, in the early/mid 1300's. It is related to
the 'Mamluk' deck of the Islamic world, which had suitscups, coins,
swords, and polo-sticks.
The Tarot was originally used for a game called 'tarocchi' in Italy,
which is sort of a distant cousin to Bridge. Tarocchi is still played
in some parts of the world, not usually with the same decks the
'fortune tellers' use.
game was quite popular for a time among the royalty in Italy, and
sometimes a duke would commission an artist to create a really nice
deck. Some of the earliest surviving Tarot decks come from this
Joker of 'standard' card decks is "not" related to the
Fool of Tarot. The Joker was invented as a wild card for Euchre
in the 1800's, in a part of the world where the Tarot was virtually
or totally unknown.
Tarot was first associated with the occult by Antoine Court de Gebelin,
a relatively obscure Parisian mason who wrote about the deck in
1781. He invented a lot of the standard myths about the Tarot which
were later popularized by others (it comes from ancient Egypt, the
Major Arcana is related to the Kabalah, etc.). But of course, divination
was the most popular use for the cards.