If you are an EEA national studying in the UK you have a right to housing and benefits if:

But if you have EU settled status or if you first entered the UK after 31 December 2020 your rights to housing and benefits are the same as a non-EEA national according to the type of leave you have. For EU settled status see people with indefinite leave.