If you're academically unsat (less than 2.0 GPA, 2 Ds or 1 F) you get what's called "ac boarded." Ac boards suck. You basically have to try and find a way to prove to the board that you deserve to remain a midshipman and should get another chance academically. You can retake classes, either the following semester or during summer school. Every year there's a very small number (like ones and twos) who get delayed graduation for academic reasons. Usually these are athletes who for various reasons (time commitments plus bad grades) couldn't complete the academic program and they get one more semester to finish up.
They're more forgiving to plebes and youngsters at ac boards, but once you hit 2/C year and have signed your committment papers, you really need to step your game up.
The Academy is fully willing to kick kids out after their final finals. As in, after their last tests ever. Every year there's a few who get told that they didn't satisfactorily complete the academic program and so can't commission. They're left with a big debt to pay off and nothing to show for it after four years.