Teen Titans (2003) and Young Justice never existed in the same universe and do not fit together. Both shows use Dick Grayson (Robin) as one of the main protagonists. For Teen Titans, this is confirmed in the episode "Fractured" and the appearance of "Larry" (whose real name is Dick Grayson spelt backwards). Teen Titans is loosely based off the comic series The New Teen Titans. I say loosely because the lineup and characterisations were changed from the comic. Young Justice is a next-gen continuation of Justice League: The Animated Series. Teen Titans and Young Justice exist entirely separate from each other and share no overlap, with Teen Titans Go! episodes being the exception (but they are created for humor and are not canon content).
When it comes to other characters beyond Dick Grayson, it's a simple explanation. Cyborg was a member of the Teen Titans, but after the New-52 reboot, he was aged up, his backstory modified, and he became a founding member of the Justice League. Raven was never a member of the Justice League. She has engaged with them and has worked independently, but she always remained a Titans member. In fact, Raven was the founding member in the comics and approached Robin rather than the other way around.
For some reason, the writers continue to de-age the Titans members to fit the age of the current Robin. They also tend to recycle story arcs to include the new Robin (see: the Trigon arc, Slade/Terra's arc, etc.). The only character immune to this is Koriand'r/Starfire as she is one of Dick Grayson's love interests and therefore matches him in age. Dick Grayson remains the founding member of the Titans, but all main Robins (Dick, Jason, Tim, and Damian) have spent time at Titans Tower to train in team-building.
In the end, post-New 52, neither series is a part of the main DCU timeline. Teen Titans never tied in with other content, like movies or shows, and Young Justice now takes place on Earth-16. The latest DCU Animated Original Movies (Son of Batman, Justice League vs. Teen Titans, Teen Titans: The Judas Contract) are the current canon. The Titans members are roughly the same age as Damian Wayne; Dick Grayson is older than all other Titans, bar Kori; and there is no mention of the other Young Justice main characters in the animated films, yet.
This is probably more information than necessary, and I know others have posted briefer answers, but I hope this helps clarify the answers given.