Dorms are typically part of a contract between the student and the institution. Residency is tied to enrollment and the payment of fees. Living in a dorm without being a registered student is a breach of contract, which could lead to civil repercussions like eviction, debt collection for unpaid fees, and potential damage to your credit rating. The university also might pursue other legal actions.
In short, while not a crime in the typical sense, it's a significant contractual violation with serious consequences.