So the answer to this seems to be fairly unsatisfying, which is to say likely "We don't know". The combined efforts of several mods were unable to turn up more than a single academic treatment of the specific topic, a paper published this year by Tim Hwang (There are a LOT of papers about lava and the sea floor, though!). The broader concept of the game, that certain areas of the floor or ground are "No-Go Zones", can be found across numerous cultures and folk traditions and Hwang mentions several in passing, placing the "Floor is Lava" game into the same larger category as the familiar game of Hopscotch, which his own source traces back at least as far as the Roman Empire. Hwang also goes beyond only European games though, mentioning also a Kenyan game called mtezo, which is described by Wanderi as a 'ground avoidance game' utilizing ropes ties to trees or lianas to swing about and not touch the forest floor.
But of course, this doesn't tell us when the floor became lava, just that children have probably been avoiding the floor as long as they have been playing games. That particular permutation seems to be a development of the mid-20th century. The earliest mention Hwang has of avoiding the floor or else you'll get burned, comes from a Roald Dahl short story entitled "The Wish", although if we want to split hairs, the floor there is hot coals, not molten lava:
A tremendous carpet. Bigger than the tennis lawn. Much bigger than that. He regarded it gravely, setting his eyes upon it with mild pleasure. He had never really noticed it before, but now, all of a sudden the colours seemed to brighten mysteriously and spring out at him in a most dazzling way. You see, he told himself, I know how it is. The red parts of the carpet are red-hot lumps of coal. What I must do is this: I must walk all the way along it to the front door without touching them. If I touch the red I will be burnt. As a matter of fact, I will be burnt up completely. And the black parts of the carpet... yes, the black parts are snakes, poisonous snakes, adders mostly, and cobras, thick like tree-trunks round the middle, and if I touch one of them, I'll be bitten and I'll die before tea time. And if I get across safely, without being burnt and without being bitten, I will be given a puppy for my birthday tomorrow
The story progresses with the protagonist's journey over the carpet, experiencing this small fantasy world that he created. In the end though it is the snakes that get him, not the coals, "this bare hand of his going right into the middle of a great glistening mass of black and he gave one piercing cry as it touched."
It is of course possible that earlier players of these avoidance games similarly imagined a fiery death would befall their failure to obey the imposed limitations, but the literary evidence for this, at least, is scant. And in any case, the clear growth and appeal of the game, again, Hwang sees as a phenomenon of the latter-half of the 20th century, at least in the US, tying it specifically to the changes in family life and home design, where the growth of the family room as a common and expected part of the American home created a space for children to play in the house that was rarely present in decades past.
Clear evidence of the development of the game is lacking, and Hwang is careful to note that he "offers a hypothesis rather than a proof", but nevertheless he sees a clear, "suggestive relationship" between "The Floor is Lava" and post-war American family life. The combination of furniture to provide the 'safe zone platforms', the size of the room in comparison to a bedroom, and the casual 'social characteristics' of the family room all combined to make such a game ideally suited to the space.
So in short, children have certainly been avoiding a molten, melty-death on the living room carpet since the 1950s, but whether or not lava or some other fiery danger was what was to be avoided, these 'ground avoidance games' are a very old, and quite worldly, tradition for children through the ages. I will close with one addendum, namely that myself and other mods have been trying to see if we could find an older reference than Dahl specifically to lava, or at least a fire floor. No luck yet, but I'd welcome others joining in to help!
Dahl, Roald. "The Wish" in Someone Like You. Alfred A. Knopf, 1953
Gomme, Alice Bertha. The Traditional Games of England, Scotland and Ireland London: David McNutt, 1894
Hwang, Tim, On the Architecture of the Folk Game: The Case of 'The Floor is Lava' (February 12, 2018). Available at SSRN: https://ssrn.com/abstract=3122458 or http://dx.doi.org/10.2139/ssrn.3122458
Wanderi, Mwangi Peter. The Indigenous Games of the People of the Coastal Region of Kenya. Ossrea, 2011
Edit: This has nothing to do with actually answering the question, but one other source that did turn up and will at least make for an amusing aside:
In conclusion, from our calculations, we can see that it would not be possible to play a game of 'the floor is lava' either infoorrs or outdoors for more than a few seconds due to the large air temperatures produced due to the lava. However, the authors of this paper do believe that it may be possible to play a short game of 'the walls are lava' if convection currents are taken into account, as long as the room it is being played in doews not have a ceiling and participants attempt to inhale as few gases as possible.
Fosberry, Deven and Pratik Lakhotia. 2014. "Playing 'The Floor is Lava' in Real Life". Journal of Interdisciplinary Science Vol 3. 37-38
Edit II: I'd highly encourage everyone to also read this answer from /u/vladesko in /r/AskAnthropology, approaching from a different tack.
Hi, everybody! So, you've probably clicked on this thread because it has so many upvotes and you assume that means there's an answer - but that's not how /r/AskHistorians works. In general, people upvote threads here because they want an answer. The thing is, it can often take time for a good answer to be written. Our mission is to provide users with in-depth and comprehensive responses, and our rules are intended to facilitate that purpose. That's why we remove comments that are very short, based on speculation, or just plain inaccurate. Making comments asking about the removed comments simply makes the problem worse, and we are sick of jokes about Pompeii. So please, before you try your hand at posting, check out the rules: we don't want to have to warn you again or give you a temporary ban for ignoring them.
While you wait, you can check out places our already-answered questions are featured, including Twitter, the Sunday Digest, the Monthly "Best Of" feature, and now, Facebook. It's very rare that a decent answer doesn't result in due time, so please do come back to this thread in a few hours. If you think you might forget, send a Private Message to the Remind-Me bot, and it will ensure you don't!
Finally, while we always appreciate feedback, we ask that any comments about our moderation style and rules be sent to modmail, or a META thread. Please be aware that we've considered and discarded the idea of an "answered" flair and an automatic "free talk" comment thread many times already. Thank you!