YouTube videos can and will upload overnight as long as the computer stays on and is not in sleep mode.
If the computer goes into sleep mode then the YouTube video will stop loading or if your browser crashes then your YouTube video will stop uploading as well.
As long as your computer stays awake and your browser does not Crash then the video will continue uploading to YouTube overnight or when away from home.
I sometimes allow videos to upload to YouTube overnight or when away from home when I have other things to do and have a larger file or video to upload.
I have the computer sleep mode set to off and it continues uploading.
Your computer does not still upload when in sleep mode.
Uploads will be interrupted and fail if your PC goes into sleep mode during upload.
When your computer goes into sleep mode it stops activity such as uploads, downloads and internet connections.
So if you need to keep your computer on to upload files or download files then you can set the laptops screen to go off but still keep the computer on and out of sleep mode.
With a desktop you could just leave the computer on and shut down your computer monitor.
The application will resume uploads even if you shut down during a sync operation.
Files sent there will upload as Internet is connected.
If however you do so from a browser this may not be the case.
Some systems may view this the upload as activity and thus not sleep until the upload is complete.