I know this isn't a super profound question by this sub's standards but I can't seem to find any info on this.
*I guess I could have left out 1930-40's. Derp.
I'm by no means an expert, but I believe they were practicing a form of Light Discipline.
http://encyclopedia2.thefreedictionary.com/Light+Discipline
(Note, the article references The Great Soviet Encyclopedia, which "might be outdated or ideologically biased.", but in this particular case I'd consider the Soviet Encyclopedia a valid source.)
Even modern military members are taught about light disciple.
Humans are really good at spotting light in the darkness, able to spot a candle 48km away, under ideal circumstances. So, when you're at war it makes sense to make as little light as possible, lest some enemy aircraft swoops down and kills you. This is especially true when your enemy rules the skies, as the allies did towards the end of the war. Of course, you still need a little bit of light to keep from running into things, that's what the little slits are for.
For roughly the same reason everyone in Europe, in the countries that were at war was required to blind their windows at night (i've no idea how this applies to China/Japan), so no light would shine out, making navigation and target spotting more difficult.
EDIT: some of the lights in your pictures don't have slits, those are probably covered by blue filters, blue light is less easy to spot in the distance.
It was to reduce light output and was part of a larger effort to make cities harder to be seen by bombers.
This particular car was Hitler's Mercedes 770. At least one of them survived the war. Do you know if those pictures are prewar?
The Nazi's were hardly the only ones who did this. The English required that all windows be covered and that there be double doors in public buildings. Even the US had blackouts along both coasts, punishable by arrest.
Modern military vehicles have a three position switch for regular, blackout, and convoy modes. There is a lock on the regular mode so that you don't turn the light on by accident.
Not really a German thing, you can find examples of American and British vehicles with similar arrangements. In general this is used, still today, in military vehicles to reduce your exposure to the enemy. When moving in convoys you do not need large bean like in a modern highway but just some light to keep you going safely, having powerful light do nothing but reveal your presence. This translates into something like "tactical illumination" You can find Jeeps, trucks and similar vehicles with covers in the lights and a small slot to let some light out. Example: https://farm6.staticflickr.com/5024/5649067145_32664d40f7_n.jpg