How to get updates automatically when you're away with active hours in Windows 10

Microsoft made it easier to keep Windows current with the latest features and improvements — with fewer interruptions and restarts when you're using your PC the most.
The great news is that you don’t have to do anything to get the latest updates, as they'll automatically download and install when they’re available (unless you’re on a metered connection, then updates won’t download until you get them).
Occasionally, your PC might need to restart to finish installing the updates. You can set active hours to let us know when you're usually using your PC to help prevent inconvenient restarts.
There are two ways to set active hours in Windows 10.

Have Windows automatically adjust active hours based on your device's activity

  1. Select Start, then select Settings  > Update & Security  > Windows Update, and then select Change active hours.
  2. Turn on Automatically adjust active hours for this device based on activity. Then, select Save.

Select your own active hours

  1. Select Start, then select Settings  > Update & Security  > Windows Update, and then select Change active hours.
  2. Next to your current active hours, select Change. Select the start time and end time for your active hours. Then, select Save.
Source: Microsoft