Probably a little bit of both. Had the same issue so I started using the Pomodoro method. Helps, but you need to make a fervent effort to get up and walk away when you're supposed to.
God that's such a good method it boosted my productivity by over 200%. I owe a lot of thing to time management. I would never be able to run a business , succeed in med school and have personal life without it.
When I do things well it all falls into a splendor of a path where grades are 100% , business is humming , I go to the gym everyday , I'm in the ER working every weekend , I take care of chores , I participate in the local party meetings , I have a few dozen minutes to speak at my favorite NGO , I work on my research projects , my fiancee is happy , my family is happy and I have a tiny bit of time to go out and enjoy life for a few hours. God I love that perfection.
When I do it wrong stress plus burnout are eating me alive and I down spiral back to smoking a cig or three per day or I binge some stupid video game or series.
Here's my two cents - go to Lynda.com and watch Dave Crenshaw's Time Management Fundamentals and there's another course called Overcoming Procrastination. Watch them and live by them. They will most likely change your life. Also get OneNote on your laptop and phone , that program is a life saver.
If you lack self control just use a firewall to block yourself from junk websites like cnn , 9gag , youtube etc. You can't really block FB since it's essential for the academic life these days.