Apple - Does OS X continue to copy files when my laptop goes to sleep?
There are various modes of sleep a Mac can go into. At this point your question only describes the fact your laptop screen goes to sleep, but this is different from your computer actually going to sleep.
Regardless of your settings and assuming your MacBook Pro has a continuous power source, then a system event such as copying a large amount of data will continue to occur even if various parts of your Mac go to sleep.1 This is because if your Mac is in the middle of an action such as copying files, it will not go entirely into sleep mode (e.g. your display may go to sleep, but your drives are still fully powered up for read/write purposes).
In terms of the speed at which data is transferred, this can be affected by a number of factors, but in your scenario the transfer rate should not be impacted.
Of course, if you're copying a large amount of data, it is recommended you have your MacBook Pro plugged into an AC power source.
For more information on your Mac's sleep capabilities, you may want to refer to the following content:
- Use the Energy Saver settings on your Mac
- macOS Sierra: Optimize energy settings for portable computers
- About Wake on Demand and Bonjour Sleep Proxy
1 This answer assumes we're talking about a Mac scheduled to go to sleep as a result of its Energy Saver settings, and not because it's been manually put to sleep by the user (e.g. by closing the lid, etc).
A little trick if you want to momentally keep an eye on your transfer:
$ caffeinate -t 3600 &
This command line keep your computer awake for an hour.