To accomplish your objective you need to edit the Windows Registry.
Before making any changes to the Registry, create a restore point.
If you have any doubt on how to proceed don't hesitate to ask for help.
You can follow this step-by-step guide but increasing the milliseconds instead of reducing it: How to Specify WaitToKillAppTimeout
If this change does not do what you expect, there are other related registry entries (and guides are at the bottom of the linked article).
Determines how long the system waits for user processes to end after the user attempts to log off or to shut down Windows. When the time specified in this entry expires, the End Task dialog box appears, stating that the process did not respond. If the value of AutoEndTasks is 1, the system ends the process automatically.
- Value expressed as milliseconds in decimal, i.e. 20000 (20 seconds)
Determines whether user processes end automatically when the user either logs off or shuts down Windows.
- A value of 0 means: The system waits until the process ends, and, if the process takes more time than the value of the HungAppTimeout entry, the End Task dialog box appears, stating that the application cannot respond to the End Task request.
- A value of 1 means: Processes end automatically.
Specifies how long the system waits for user processes to end after the user clicks the End Task command button in Task Manager. If this threshold is exceeded, the End Task dialog box appears, stating that the process did not respond.
- Value expressed as milliseconds in decimal.