Questions & Answers about Když je noc, nechci jít sám po ulici.
Here když means when: When it is night... / When it’s nighttime...
In Czech, když often introduces a time clause, just like when in English. In some contexts it can also mean something closer to if, but in this sentence the time meaning is the natural one.
The comma is there because Czech normally separates this kind of subordinate clause:
- Když je noc, nechci jít sám po ulici.
You could also reverse the order:
- Nechci jít sám po ulici, když je noc.
That still means basically the same thing.