Does Dropbox sync when computer is asleep or locked?
We don't know what your system is, so I'm a little fuzzy on the definition of 'locked' for you.
Under a Windows OS, if you lock the screen (that is, stay logged in, use Win+L or 'lock' under the start menu to lock it), then yes, Dropbox will continue to run and sync.
Under a Windows OS, 'sleep' means that the computer is off and not running programs, but memory is being held live so that it can wake up very quickly. In this state, NO, dropbox can't sync, because it's not running.
I had this problem on Windows 10 where drop box didn't seem to sync when locked. Issue was wireless disconnected when locked to save power.
See this link
In short, Device Manager -> Right click device, Properties -> Power Management -> Allow the computer to turn off this device to save power
No, it wont, however there are many programs out there to keep your pc awake such as Caffeine.
Caffeine for Mac: (Direct) (Mac App Store)
Caffeine for Windows: (Direct)