Apple - App for Blocking Website in Safari (For Productivity Purposes)
SelfControl is a free app that will let you enter the websites you want blocked and for how long you want them blocked for.
WasteNoTime is a good app for this. It is a browser extension.