SSDI is Social Security and based on your past work experience, disability, and your ability to work; food stamps come from local/SSI-related services which is just your disability and income. It gets a little iffy there if you are claiming mental disability (say, depression) and then are taking a full classload, no problem? But just because you are on SSDI/SSI, there's nothing specific saying you cannot go to school.
Can I Start School Full Time While on Disability? | Disability Secrets
I would also think about your funding though; you probably won't qualify for food stamps, for example, if you are able to pay for school in some way? Where is the money for school coming from; that would have to be declared somewhere for SSI I'd think.