There are some programs that allow early separation, but they are very specific. Such programs are early separation to join a commissioning program, valid hardship reasons (such as a member of your family is dying), early separation (up to a year early) to join the Guard or the Reserves, early separation (usually up to six months early) to enter a college program.
For details, see the article, Getting Out of the Military.
While you can't just quit anytime you want, the military can throw you out, if you fail to meet or maintain standards. This is called an "involuntary administrative discharge." For an overview of the military involuntary administrative discharge system, see the article, Administrative Discharges.