I must have read this book about 15 years ago or so. It was intended for young adults.
The thrust of the story is this kid wakes up to find that his parents are missing. Upon further exploration, he realizes he's the only person still left in this major metropolitan city. He comes across another girl his age however, I think her name was Skye.
They explore and come to find out that they're actually part of some psychological experiment and are in a synthetic environment on another planet. In essence, scientists wanted to see if someone taken from reality and placed in another environment could survive solely on imagination. The "city" they are in is merely a projection from their minds.
As the main characters realize they're not really on Earth, reality sets in and the poisonous, hostile environment becomes their reality. The scientists, dressed in spacesuits, implore them to come to safety. Instead, the main characters feeling betrayed, attempt to "believe" they are really on Earth and things go back to normal.