It is always best to let your landlord know that you are planning on subleasing your room. It’s also wise to revise the terms of your tenancy to see if your landlord has already covered this in your lease agreement.
If you are caught illegally subletting (subleasing without explicit permission) you could be evicted by your landlord for breaking the terms of your agreement.