The Doors Are Always Closed, It's Fine.
Germany is not the biggest fan of open door plans. Okay, let me clarify: every room has a door, every door has a lock, and Germans like to make liberal use of both. Regardless of whether it's the living room, kitchen, or even two parts of a hallway, the doors are there and likely closed. If you're going to an office or university building, even during "open" hours, the doors will be closed and likely locked up as well. What do you do about this?
The easiest to start with are offices. If you have an appointment or are going to an office that is supposed to have open hours, you'll have to knock. Exactly once, no more than once, and don't try to open the door yourself unless or until you are called in. The privacy of the people who are visiting whatever office you are at is very highly regarded, and keeping the door closed during and between appointments is the standard way of ensuring that it is kept. This is true for everything from the immigration office to a professor's office.
If you are visiting a German's house or apartment, assume until told otherwise that the doors which are closed are meant to keep you out. It may be that there's simply a mess behind whatever door is closed (who hasn't "cleaned" up for company now and then by cramming the mess out of sight?), or there may be no real reason to keep it out of sight at all, but it's safer to assume you shouldn't open it. Should you need to do something like use the bathroom, and all the doors are closed, make sure you are clear on which room is correct (at least if your confidence in your Germany is shaky).