Similar to Joe Phillips' answer -- find another project/thing to do with your time. Like the old saw: "Get a girlfriend."
Of course, replacing one addiction with another isn't really a solution -- if your problem is that you're losing productive parts of your life and it's affecting your relationships, then you just have to sit down and have a good hard look at yourself and decide what you want to do. Do you want to play games for hours on end every day, or do you want to to something else? As long as you're in that space that says "well, there's nothing really wrong with it", then you're not going to change.
Also, if you're asking on behalf of someone else -- that is, if the question is really "how can I get someone else to quit their addiction?" -- the answer is: you can't.
Old joke: Q. How many psychotherapists does it take to change a light bulb? A. Only one, but the lightbulb has to want to change!
Speaking of which, if the problem is to the point where it's ruining your life, you might consider professional help. Better now than wait until you've got 20 years of this behind you.