We are what we hang out with. Spend all time with slackers and gamblers, you will become a gambler. Spend time with smart people, you will get smarter, whenever you want it or not. A person will try to stay with everyone on the same level and it will motivate him to be better.
While being a student, it is best to surround yourself with excellent students, and it wont be a problem if they gamble or not, as they will always find time to study.