Windows allows you to schedule the computer to go to sleep or shutdown, but the options are quite limited.
How to schedule computer shutdown
The free Switch Off utility offers more fine-grained settings and lets you create “scenarios”.
Start by downloading it at: http://www.airytec.com/en/switch-off/get.aspx by clicking on Download in front of Full version.
The software is in English. To translate the interface, click Download in front of Language files.
Get the French language file, then put it in the folder lng from the folder where Switch Off is installed. By default, this is the folder Airytec in Program Files. Once Switch Off is launched, its icon appears in the Notification area. Right click on it then open the menu Options. In the tab General, pull down the menu Language, French then validate with Apply and do okay. Right-clicking on the program icon opens a menu with different scenarios allowing you to shut down the computer after a specified period of time or period of inactivity.