I have heard that student visa’s disappear quite quickly if you are no longer a student. You might have to take enough courses to maintain your student visa and not graduate until May unless you either have another legal way to stay in the US, or want to return to your home country right after graduation. However, the foreign students office at your university should know the details of this better than than I do. Do not overstay your visa if you will ever want to be able to get another one in the future.
As others have pointed out, getting into and paying for medical school can be tough for an international student.