What could be the reason for his return and what can be done to manage such situation?
If you are a gambling addiction, of course your friend is also a gambler and the environment where you live does not escape gambling, even though it is done secretly, So if you still live in the area there is no way even if you stop, one day you will return to gamble.
If you really stop gambling "Hijrah" that is the best solution, you only live where it is far from the word gambling and internet access, if you need the internet you will go at least a few kilometers for internet access And use ordinary cellphones for communication, not Android, that way I am sure that gradually you will forget the world of gambling.
The reason, if you are still friends/hanging out with those who often gamble, there is no way of two or three months not tempted, then you are worse than the first gambling.