Being free from gambling requires making a good decision and standing by it and it takes a long while for one to be free from gambling which depends on what the person gamble for, if it's plainly for fun and the person is discipline with their bankroll then the person can be free from it but a situation where the person is addicted and can't control their habits then it's going to be hard for such gambler to be free from gambling forever except otherwise.
A player who has been gambling for a long time will not just quit gambling. And simply resisting your desire to play is not the right choice, because it will not go away and then you will have a feeling that you are limiting yourself against your will. It is better to limit your budget, play for small stakes and try to do it as rarely as possible. Find other sources of income, find another hobby so that it takes up more of your time, this is the best way, if there is such a task - to get away from gambling.