How long are you obligated to stay in the marine corps? And what is to be expected of the training?

Lets say I join the infantry after high school. How long will I be in there? Can I leave early?
And what will the training be like? what will i be learning?
4 answers 4