Mac OS X allows you to set time limits for computer usage by way of Parental Controls. With the feature, you can set different limits to computer use for weekdays, weekends, and even set bed times, whereby the Mac would be unusable between some specified hours. This is obviously a good way to set computer use time limits for kids, but it can also be a handy way to force some self control on yourself if you struggle separating work from play, and otherwise just spend too much time on the computer.
If you haven’t done so yet, you will need to create a new user account on the Mac, this can be done quickly through the Users and Groups control panel. Assuming you have the new account created:
From System Preferences in the Apple menu, choose “Parental Controls”
Click the lock icon in the corner to unlock the control panel and enter the administrator password
Select the user account to set time limits for from the left side, then select the “Time Limits” tab
Check boxes and adjust the sliders as appropriate for the desired time limitations
Close out of Parental Controls when finished
With Time Limits configured, the next time the user accesses that account they will be confined to the timing restrictions that were indicated. The “Limit computer use” options are generic in that a restriction of 3 hours a day can be used for a grand total of 3 hours a day at any time of the day. The “Bedtime” feature allows you to specify clock hours if you want the user account to only have access during specified hours.
Parental Controls has a lot of other helpful options available too, like preventing certain apps from being used, limiting contact with certain people, profanity filters, and more. The name makes it obvious that the feature set is geared towards parents for their children, but I know several individuals who use different user accounts for separating their home and work lives, and also to limit distractions from apps like Twitter.