Preventing myself from accessing certain websites

Hello,
Is there any way to make some settings so I can't access certain websites? Perhaps something that can block certain websites for a set time, and won't allow me to access them no matter what I do, for a set amount of time? There are some online games that I do not want to play but I always see myself playing them and wasting my time. So can this be achieved?
