I usually keep the window open at night and have never had anyone say anything. I thought the only rule around that was they had to be shut during take-off/landing if the cabin lights were on.
They actually have to be open during take-off/landing, in case of a crash the rescue crew has to be able to look inside the plane from the outside.
And the lights are dimmed on a nighttime takeoff/landing so that, in the event of needing to evacuate, your eyes don't need to adjust as much as when going from very bright to very dim.