For many, this question is an open and shut case. J.K. Rowling answered a very similar question during her Web Chat Interview for Bloomsbury on July 30, 2007.
Elisabeth: In the chapter of kings cross, are they behind the veil or in some world between the real world and the veil? J.K. Rowling: You can make up your own mind on this, but I think that Harry entered a kind of limbo between life and death.
For more than a decade this question has intrigued me. I have read the Deathly Hallows more than a dozen times and combed through The Prince’s Tale and King’s Cross hundreds of times in search of an explanation.
After failing to reach an answer, I began reading about real-life people who were alive after being medically declared dead. Some had surreal, out-of-body, experiences with shocking life realizations while others had more mundane encounters that left them feeling as if their body was in a state of nothingness.
We are left with the question that Harry poses “Is this real? Or has this been happening inside my head?”
JK Rowling’s explanation can allow someone to be in a “limbo” between life and death while still occurring inside of Harry’s head. His experience is similar to real-world commentary from people who have cheated death, despite being pronounced dead by medical personnel.
I then realized that JK Rowling's explanation did not mean that the "limbo" that Harry was in could not happen only in his head. In fact, it seemed that Harry's experience was quite similar to real-world commentary from people who had cheated death after being pronounced dead by trained medical personnel.
After carefully examining every single line of dialogue in King's Cross I came to a surprising realization...
Everything Dumbledore explains to Harry, Harry already knows or should know through deduction.
Before Dumbledore begins "explaining" to Harry why he is still alive he opens with the statement "But you already know." He follows this with an explanation that is essentially what Harry already knows based on the memories that Severus had just given him shortly before his death.
Shortly before Dumbledore's rehash of his past, he declares "But you know, don't you? I have no secrets from you anymore. You know." When Dumbledore finishes talking about Grindelwald, as the reader, I am left with no new information. All of this was explained by Aberforth, or hinted at, throughout the other six books.
The only time we are left with a "guess" is when Dumbledore explains about the wand connection that was present during Harry's fight with The Dark Lord while the latter was using Lucius' wand. Harry asks Dumbledore to give him his best guess, given that Dumbledore ALWAYS spoke about love and its power yadda yadda yadda… this feels like a Dumbledore-Esque solution that Harry comes to during his out-of-body epiphany.
The entire conversation between Dumbledore and Harry never feels like an "explanatory" chapter, but rather feels as if Harry is internalizing all the information he has been given. I have been known on many occasions to hash out my problems out loud vocalizing a conversation between myself and what I believe various friends would in support or against what I am thinking.
So yes, I believe that Harry was in a limbo state, a state between life and death. I believe that it all happened within Harry's head, that Dumbledore was NOT there, but rather Harry was making sense of all that had happened and projected Dumbledore because he was so used to him giving the answers that he needed.