I heard from many where that a man who introduced the game Chess was hanged or killed by the King of that time, What was the actual story? What was the reason?
The exact origins of chess are not known, but there are several stories about it out there. At the top of my head I can think of at least four different ones that I've heard myself, and after reading your question I suspect that you've heard of one such story about the creation of chess.
One of these, which may or may not be the story you seem to have learnt about, is the one that follows:
A long time ago, a bored king asked one of his underlings to bring him some form of fresh entertainment. The underling thought for a while, and came up with the game of chess. After playing one game, the king was so pleased with what the underling had brought him that he said that the underling could ask for anything he desired as a reward for the invention of the brilliant game.
After contemplating for a while, the underling asked for a grain of rice for the first square of the chess board, two grains of rice for the second square, four grains for the third square, and so on for the remaining squares. The king agreed to the request, and when it was realized that the total amount of grains the underling had asked for was impossible for the kingdom to provide, the king got angry and ordered the execution of his underling for making a fool out of him.
It is important to note, however, that this story has no proven historical validity whatsoever.
That story seems to be a Hindu legend of the Ambalappuzha Sri Krishna Temple.
Basically the story goes:
The god Krishna, disguised as a sage, appeared in front of a king and challenged him to a game of chess (chaturanga?). The king accepted and asked him what prize he wanted if he won. He said he was a man of few needs so asked for a few grains of rice, the exact number being determined using a chessboard as following: one grain of rice would be placed on the first square, two on the second, and so on doubling the amount each time. The king was unhappy with his request and offered more riches, but he declined.
The game started, and the sage, being a god, obviously won. As the king started to pay the sage's prize, he realized that there wasn't enough rice in his kingdom to pay the prize. The sage transformed back into his god self and told the king the prize didn't have to be payed immediately. He would serve paal-payasam (some sort of food made of rice) to pilgrims every day until the debt was payed off.
In this story, no one dies, and it seems like this is the most correct version, as it's part of Hindu culture.
(There is also more information over at Hinduism SE).