Darkness in the Gospel of John
At first, it may seem like a stretch to believe that the narrator of John mentioning that Nicodemus came to Jesus in the night has any real significance. However, one has to take the entire Gospel of John into account.
Recall that at the very beginning of John we are told "In him (Jesus) was life and the life was the light of all people. The light shines in the darkness, and the darkness did not overcome it." (John 1:4-5) This is a clue that, throughout this gospel, the reader should look for scenes that involve light and scenes that involve darkness. It is setting the stage for the whole gospel.
If that isn't enough, look at John 13:30. Judas leaves to go and betray Jesus and prepare to hand him over to be killed. This is the moment that was foreshadowed as the main conflict in this gospel. This is the most evil moment in this gospel. And what does the narrator of John tell us right after Judas goes out to betray Jesus? "And it was night." It doesn't get more ominous than that, does it?
If you still aren't convinced that this is an intentional theme in John, turn to the garden scene in John 18, where Jesus is arrested. The narrator makes sure to point out that the soldiers came with "torches and lanterns," another sign that darkness is still reigning in this most evil of events.
When you see "night" or "darkness" in the gospel of John, most likely, someone is about to betray their ignorance of what God is doing in Jesus.