Getting into trouble with the law as a college student can put the breaks on getting much-needed financial aid. It typically will depend on the conviction or charges you face.
The U.S. Department of Education explains you will need to consider the charge on your record and your incarceration status when applying for financial aid.
In the past, drug convictions made you ineligible for federal financial aid, but that changed. It no longer will impact your eligibility. The main restriction now is for involuntary civil commitment for a sexual offense. This will limit what aid you can get, making you ineligible for a federal pell grant. The pell grant eligibility is a requirement for certain other types of aid, so you would be ineligible for them as well.
If you have already gone through court and received a jail or prison sentence, you will have limits on your ability to get financial aid. You are ineligible for federal student loans and cannot receive a pell grant. You will be able to apply for a Federal Supplemental Educational Opportunity Grant and work-study, but you probably will not qualify for them either. To get an FSEOG, you have to also receive a pell grant, and you cannot do that. Work study options also probably will not be possible because of the general nature of how they work and your incarcerated status.
Do keep in mind that you can apply for help you will receive after you leave prison or jail, and at that point, you would probably be eligible for the various types of aid.