ApgAuto MPG solves this very problem. This is an application that turns your computer off automatically after a pre-determined time.
You will not need much time to work out how to use it. Simply select the action you want to perform (shutdown or restart) and choose the period of time that you want to leave it on for. From there, ApgAuto MPG starts counting down the time.
ApgAuto MPG is a very easy and effective option to automatically shut down your equipment, and is definitely worth trying out.