If you are still studying in the school as a full time student, you are legal; if you already graduated holding OPT, you are legal until your OPT expires even your original F-1 visa may expire later.