Is there a way to configure Android to turn off notifications at a specific time and turn them on at a specific time? Pretty much I don't want to hear notifications at 3 AM from anyone or anything.
There are several automation apps in the playstore which deal with this kind of subject. Some of them are simply time-based (which would match your question), such as e.g. Timeriffic1 -- others additionally can react on other conditions like location, calendar and more (e.g. MyProfiles2). The top end of flexibility can be reached with Tasker -- there's almost nothing this app couldn't do. It needs some time to get used to, and costs some money, but for sure it's worth it.
There are a lot of more apps like the mentioned ones, so just take them as examples for further "investigation" in the playstore. There also is a German listing on AndroidPIT (Automatisierung -- Profile-Switcher & Co -- Google Translate Version) to give you a faster start looking for alternatives.