Raised by Eraqus from a very young age. Given Terra's speech to Riku as a child, it can be assumed that Terra was also not from the Land of Departure, especially given the fact that Eraqus apparently shaped that world.
Likely, when Eraqus was journeying, he encountered Terra as a small child. Given the fact that he refers to Eraqus as his father and left for the Land of Departure at such a young age, it can be assumed that he was likely an orphan.
One could extrapolate this to be the source of his desire for power- Like Riku, he wanted to protect the things that matter, but he couldn't because he was a tiny child at the time. Thus, orphan.
Anyway, that's off-topic. Soon after Eraqus left, Terra balls-out willpowered a portal open (Like beast! A dark portal.) and followed Eraqus to the Land of Departure. Eraqus immediately saw the dark portal and took Terra in, training him in the ways of light, trying to stamp out the darkness in him. (We know how well that worked out.)
Terra was the first pupil, and the oldest. Eraqus still left from time to time, so Terra was somewhat self-sufficient for when he was left in the Land of Departure alone. He was a good pupil and trained diligently. Aqua eventually came to show up in the Land of Departure as well.
They trained for a long while, and Ventus eventually showed up too. Probably a couple years before the game proper! Not too long as none of them changed much, but long enough for them to be bffs forever.
In training, the three of them were pretty much, as said, bffs. Aqua was the best at magic, but Terra excelled in physical power and in manipulation of his Keyblade (see: Ultima Cannon, all of the Sentiment's moves, the fact that he has a unique method of summoning it). Ven was, of course, the fastest of the trio, but given his training under Xehanort, the other two were far more skilled.