For over twenty years I’ve been asked this question by my clients. For overnight, I usually shut it down if I’m doing nothing on it. This week I have left my main desktop computer on overnight for several days because I didn’t want to lose the web sites I was using. Usually, I disconnect the network connection unless it’s updating the operating system, backing up something or moving files to a file server or smartphone.
When the network is off, it’s going to be impossible for hackers, viruses and other bad things to access the computer. I had a client who worked in building security that would disconnect their internet when they didn’t need it and continue working locally with internal programs.
The chance exists for the hardware getting too hot when the the computer runs for several days straight. I would check the PC case for high heat while it’s been running overnight to prevent this. It’s possible for case and internal fans to fail which could cause this.