Please explain time travel and the realm of sleep in Kingdom Hearts 3D
Here's my understanding, gathered as a result of listening to people who really think about the series, read developer interviews and managed to predict a few elements of this game pre-trailer.
1:
To enter the Realm of Sleep, Sora and Riku needed to 'ride' a world as it fell to darkness. Since no worlds were falling into darkness at the time they needed to enter the sleeping realm, Yen Sid sent them back to Destiny Islands just before it fell to darkness in the first game. There, Riku and Sora stole the raft their past selves had built with Kairi, and rode out to the ocean. Then, after battling Ursula, the world finally started to fall to darkness. This allowed Sora and Riku to enter the 'Realm of Sleep', their Keyblades automatically unlocking the first Keyhole (thus allowing Destiny Islands to return to its original state at the end of the game). However, only Destiny Islands was in the past- the rest of the worlds in the Sleeping Realm are happening at the 'same time' as when Yen Sid originally told them what to do.
2:
I'm not entirely sure on this one, but I do know that the whole reason Ansem was on Destiny Islands in the first game (talking to Sora about darkness before the world fell) was to wait for Sora and Riku's future selves, and to follow them into the Sleeping Realm. The time travel Xehanort uses requires there to be a version of himself present- that way, he can travel anywhere he already exists in some way. Youngnort traveled back to the point where DI was about to fall to darkness, followed Sora and Riku, and as they opened the door to the Sleeping Realms he slipped in behind them before it closed.
3:
This one didn't seem to be mentioned in the game, but it's generally said that Xehanort's Heartless transferred his time travel capabilities to Youngnort when he visited him on Destiny Islands, allowing him to cheat that particular rule.
Incidentally...
the method of time travel used by Sora and Riku is different from the method used by Xehanort. Sora and Riku don't lose their bodies to travel, much like how the doors in KH2's Timeless River worked. I suspect spellcasters as powerful as Merlin and Yen Sid can use different forms of time travel, while Xehanort is restricted to his own rule-laden one.
To add to everyone's account, it is implied that Sora and Riku did lose their bodies when they travelled back to Destiny Island. That is why even though Sora was in Sleep his body was in the Tower. They were just hearts in the Realm of Sleep. Yen Sid probably somehow found a way to preserve their bodies. Them being just hearts would explain why Riku became a Dreameater, which are the Heartless equivalent in the Sleeping worlds.