3D is set after the events of Kingdom Hearts Re:coded. And the rest I'll put in spoilers:
SPOILER
Info: http://en.wikipedia.org/wiki/Kingdom_He ... p_Distance
Following the destruction of "Ansem" and Xemnas at the hands of Sora and Riku, Xehanort is revived. In response, Yen Sid decides to put Sora and Riku through the Mark of Mastery Exam in order to become full-fledged Keyblade Masters and counter Xehanort's threat...So maybe this game takes place just before the Mark of Mastery and prepares Sora and Riku to it in virtual spaces?
...According to an interview, Nomura said the game will take part, at least partially, on the Mark of Mastery.
Info: http://en.wikipedia.org/wiki/Kingdom_He ... p_Distance