Ambalappuzha Sri Krishna Temple located in Kerala, India.
According to the story,
The King of Ambalappuzha was a big chess enthusiast. One day a sage challenged him (the king) to play the chess. To motivate this Sage, the King offered any reward that the sage could name. The sage modestly asked just for a few grains of rice in the following manner: the king has to put a single grain of rice on the first chess square and double it on every consequent one. So King accepts this and the game was started. Having lost the game and being a man of his word the king ordered a bag of rice to be brought to the chess board. He started placing the grains according the reward asked by the sage.
The following picture describes growth of number of grains:
From the above image, at 64th square King has to place the total number of grains are about 9 million trillion tons.
Upon seeing the dilemma, the sage appeared to the king in his true-form, that of Lord Krishna. He told the King that he did not have to pay the debt immediately but could pay him over time. The king would serve paal-payasam (made of rice) in the temple freely to the pilgrims every day until the debt was paid off.
Here is one more image from Google images (In any case, if the above link is not accessible) :
Who was that King?
As these links (or any other) do not mention any references to Scriptures or Purans. I'm curious to know the actual story according to Hindu Scriptures.
Also Why Krishna played this Leela?