No, It is not necessary to stay in hostels. It depends only on you.
I have done B.Tech from there. I have some friends who lived in the hostel for 2 years and then they left the hostel because there is strictness for hostelers i.e they can't go outside the college without permission. So, my friends lived for the rest 2 years in the nearby city i.e. Samalkha (5-6 kms from college).