If you don't have any third party programs or weird settings this should work.
for win 7:
search power options in star button
1.change plan settings( the one that is selected)
2. You will see the setting that you want to change on the left column in power options