In the book The Lawful and the Prohibited in Islam Shaykh Yusuf al-Qaradawi made a claim:
Researchers have proven that chess did not appear until after the death of the Prophet
Did chess not appear until after the death of the Prophet?
Well, I guess it would depend a lot on what you consider the first chess game, really. If we're talking about the modern chess game, then yes, chess didn't appear until after the death of the Prophet. In The Oxford Companion to Chess, Hooper and Whyld explain that the modern chess rules evolved from the game of shatranj (or chatrang) between 1200 and 1500, way after the coming of the Prophet.
However, if we are talking about the concept of chess and accept chess-like games as evidence for the development of the modern chess game, then it is safe to assume that chess-like games existed way before the coming of the Prophet. According to chess historian Gerhard Josten, the three core types of pieces found in chess can be traced to games played in different regions of the world way before the rise of the Muslims.
Type 1: A relatively immobile central piece, the goal of the game being to paralyse this piece. The way in which it can be paralysed varies.
In the modern game of chess, the King is the only type 1 piece. Its role is crucial, as it provides the means to victory. Such pieces were found in Liubo, a game that was very popular in the Han dynasty (206 BC – 220 AD) in China, even though it was probably invented a few centuries before that time. As such, the core concept of chess, the key to victory, is borrowed from games that existed in China between 2000 and 3000 years ago, definitely before the Prophet's time.
Type 2: A number of pieces which can make various longer moves and – with some exceptions – can move in all directions without restriction.
In modern chess, these pieces would include the bishop, the rook, the queen and, if stretched a bit, knights. Josten believes that these pieces are inspired by tools used to divine the future in ancient Mesopotamia. The pieces were used in conjunction with an astrolabe, and probably greatly influenced the development of the byzantine chess game that played on a circular board, a game that also appeared before the coming of the Prophet.
Type 3: A number of pieces which can only move forwards, and if needs be sideways too.
The pawn would be the best example of this type of pieces. Josten believes that these simpler pieces come from the old race-type games that were very popular throughout the ages in India. In pachisi, the Indian national game, the pieces advance on a fixed track to reach the end goal, capturing the adersaries' pieces along the way. In such games, the pieces usually can't diverge from their original course and it is impossible for them to move backwards, much like the chess' pawns.
Josten concludes that a tri-parallel development must have been possible.
The Near Eastern astrolabe with its differentiated pieces assimilated the Chinese central piece and the Indian race pieces. The result in the Near East would have been a game of chess played on a circular board: a game like Byzantine chess. The game did not survive in this form. Whether and how its circular board was replaced by a square grid in a further phase and became the predecessor of the Western game of chess will have to be clarified at a later date.
The Near Eastern differentiated pieces and the Chinese central piece were added to the Indian 8x8 board for Asthapada with race pieces and the use of dice. The result in India would thus have been four-handed chess, the first Indian type of chess at all, a game that practically no longer exists today. The dice and the game for four was retained whilst the Chinese central piece lost its function.
The Near Eastern differentiated pieces and the Indian race pieces were adopted in the as yet unknown, early form of the Chinese chess game Xiangqi. This led to a game in China which, under the influence of Liubo and Weiqi, experienced its own separate development, the individual phases of which we still know little about. The river on the Xiangqi board, unknown in all other chess games, almost certainly came from Liubo, the central field of which according to Röllicke was called "Water". I regard this a further, very important indication of the kinship of old games.
These games evolved in parallel and influenced each other. Chess historian Isaac Linder suggests that the Kushan Empire, a region located at the crossroads of the places that gave birth to the games Josten suggests as being the core influences on chess' development, might be the birthplace of the chess game. Linder has presented pieces of a game that clearly resembles chess but predate shatranj. It is not impossible that the game of shatranj itself was influenced by this game, as elephant-like pieces were among those uncovered.
By combining those two sources, it is possible to conclude that the game of shatranj evolved from an earlier game that appeared in the Kushan Empire between 50 BC and 200 AD as a result of the combination of concepts borrowed from sophisticated games found in nearby regions.
Chris' answer relates very well how the Muslim world came upon the game of chess/shatranj, and also hints at the fact that the muslims probably did not invent it, but rather propagated it. I hope this answer helped you understand the birth of this wonderful game. I highly suggest reading the Josten article, as it is well documented and referenced, as well as being a fascinating read.
According to the origin of chess on Wikipedia,
The earliest precursor of modern chess is a game called chaturanga, which flourished in India by the 6th century, and is the earliest known game to have two essential features found in all later chess variations — different pieces having different powers (which was not the case with checkers and go), and victory depending on the fate of one piece, the king of modern chess.
The article then goes on the explain the transition of chess to Persia and then the transition to the Muslim world.
Chess was introduced to Persia from India and became a part of the princely or courtly education of Persian nobility. In Sassanid Persia around 600 the name became chatrang, which subsequently evolved to shatranj, due to Arab Muslim’s lack of ch and ng native sounds, and the rules were developed further. Players started calling "Shāh!" (Persian for "King!") when attacking the opponent's king, and "Shāh Māt!" (Persian for "the king is helpless" – see checkmate) when the king was attacked and could not escape from attack. These exclamations persisted in chess as it traveled to other lands.
The game was taken up by the Muslim world after the Islamic conquest of Persia, with the pieces largely keeping their Persian names.
The Arab conquest of Persia (Persian: تجاوز اعراب Tajāvoz-e Arāb "the attack of the Arabs" or ظهور اسلام zohur-e eslâm "the dawn of Islam"), led to the end of the Sassanid Empire in 644, the fall of Sassanid dynasty in 651.
Since this conquest did not completely end until 651 and Muhammad died June 8, 632 AD, one could argue that chess was not brought to the Muslim world until 651, which is well after the death of Muhammad.
However chess continued to develop until the 19th century when the bishop and queen were changed so they could move how they do now and several other rules of the game were changed.
The queen and bishop remained relatively weak until between 1475 AD and 1500 AD, in either Spain, Portugal, France or Italy, the queen's and bishop's modern moves started and spread, making chess close to its modern form. This form of chess got such names as "Queen's Chess" or "Mad Queen Chess" (Italian alla rabiosa = "with the madwoman"). This led to much more value being attached to the previously minor tactic of pawn promotion. Checkmate became easier and games could now be won in fewer moves. These new rules quickly spread throughout Western Europe and in Spain, with the exception of the rules about stalemate, which were finalized in the early 19th century. The modern move of the Queen may have started as an extension of its older ability to once move two squares with jump, diagonally or straight.
Following this evidence the Muslims had chess by at least 651, which is after Muhammad had died. There is considerable evidence that they did not invent the game, but mainly helped pass the game from Persia to Europe. As far as the game and its rules are concerned, most of it appears to have been developed in India and Persia (pre-Islamic conquering) and then later modified to its modern form largely due to Western Europe and Spain.
I know a lot of these sources are from Wikipedia, but they were the only ones that I could find with citations in them. There are other articles about this with similar information, but have no citations.