When I was an employee, I counted up one day and discovered that I spent 2-3 hours/day surfing the web! (I later learned that this made me a pretty good employee in the US, but I decided to try to restrict myself to my breaks anyway.)
My employer was relatively flexible, so decided that I just had to give him 7.5 hours every day (8 hours - .5 hours paid break). I started tracking my time, and made sure that I gave him 450 minutes every day, no matter how late I had to stay to do that.
I quickly found that clicking that link didn't sound as good as going home at 5.
So you might try setting a certain amount of time you want to spend on study, or determine the things that absolutly have to get done. Then tell your girlfriend that you'll call her as soon as your studying is done. If you want to surf the web, that's fine, but you're taking away from time you could be spending with her. And I'm sure your girlfriend will be honored to be your motivation.
May not work for you -- just throwing out ideas.