Like many of Dostoevsky's stories, "White Nights" is told in the first person by a nameless narrator. The narrator is a young man living in Saint Petersburg who suffers from loneliness. He gets to know and falls in love with a young woman, but the love remains unrequited as the woman misses her lover, with whom she is finally reunited.
The short story is divided into six sections:
The narrator describes his experience walking in the streets of St. Petersburg. He loves the city at night, and feels comfortable in it. He no longer feels comfortable during the day because all the people he is used to seeing are not there. He drew his emotions from them: if they were happy, he was happy; if they were despondent, he was despondent. New faces made him feel alone. As he walked, the houses would talk to him and tell him how they were being renovated or painted a new color or being torn down.
He lives alone in a small apartment in Saint Petersburg with only his old and unsociable maid Matryona to keep him company. He tells the story of his relationship with a young woman called Nastenka (a diminutive of the name Anastasia). He first sees her standing against a railing, crying. He becomes concerned and considers asking her what is wrong, but eventually continues walking. There is something special about her and he is very curious. When he hears her scream, he intervenes, saving her from a man who is harassing her.
The young woman holds his arm, and he explains that he is alone, that he has never known a woman, and that he feels timid with her. Nastenka reassures him that ladies like timidity and she likes it, too. He tells her how he spends every minute of every day dreaming about a girl that would just say two words to him, who will not repulse him or ridicule him as he approached. He explains how he thinks of talking to a random girl timidly, respectfully, passionately, telling her that he is dying in solitude and that he has no chance of success with her. He tells her that it is a girl's duty not to rudely reject or mock one as timid and luckless as he is. As they reach Nastenka's door, he asks if he will ever see her again. Before she can answer, he adds that he will be at the spot they met tomorrow anyway just so he can relive this one happy moment in his lonely life. She agrees, stating she can't forbid him not to come and she has to be there anyway. The girl would tell him her story and be with him, provided that it does not lead into romance. She too is as lonely as the narrator.
On their second meeting, Nastenka seeks to find out more about him. He tells her that he has no history because he has spent his life utterly alone. When she presses him to continue, he suggests that he is of the type of the "dreamer". " 'The dreamer' " he explains, "is not a human being, but a creature of an intermediate sort." He gives a long speech (in a style that anticipates that of the Underground Man in Notes from Underground), about his longing for companionship, leading Nastenka to comment "...you talk as if you were reading from a book". He begins to tell his story in the third person, calling himself "the hero." This "hero" is happy at the hour when all work ends and people walk about. He references Vasily Zhukovsky and mentions "The Goddess of Fancy". He dreams of everything, from befriending poets to having a place in the winter with a girl by his side. He says that the dreariness of everyday life kills people, while in his dreams he can make his life as he wishes it to be. At the end of his moving speech, Nastenka sympathetically assures him that she will be his friend.
Nastenka tells the narrator her story. She grew up with her strict grandmother who gave her a largely sheltered upbringing. Her grandmother's pension being too small, they rent out their house to gain income. When their first lodger dies, he is replaced by a younger man. The young man begins a silent courtship with Nastenka, often giving her a book so that she may develop a reading habit. She takes a liking to the novels of Sir Walter Scott and Aleksandr Pushkin. On one occasion, the young man invites her and her grandmother to a performance of The Barber of Seville. On the night that the young lodger is about to leave Petersburg for Moscow, Nastenka urges him to marry her. He refuses immediate marriage, saying that he does not have money to support them, but assures her that he will return for her a year later. Nastenka finishes her story at the end of this, noting that a year has gone and he hasn't sent her a single letter.
The narrator gradually realizes that despite his assurance that their friendship would remain platonic, he has inevitably fallen in love with her. He nevertheless helps her by writing and posting a letter to her lover, and conceals his feelings for her. They await his reply to the letter or his appearance, but Nastenka grows restless at his absence and takes comfort in the narrator's friendship. Unaware of the depth of his feelings for her, she tells him that she loves him because he hasn't fallen in love with her. The narrator, despairing due to his unrequited love, notes that he has now begun to feel alienated from her as well.
Nastenka despairs because she knows that her lover is in Petersburg but hasn't contacted her. The narrator continues to comfort her, for which she is extremely grateful, leading him to break his resolve and confess his love for her. Nastenka is disoriented at first, and the narrator, realizing that they can no longer continue to be friends in the same manner, insists on never seeing her again. She urges him to stay, and suggests that their relationship might become romantic some day, but that she wants his friendship in her life. The narrator becomes hopeful at this prospect. As they are walking, they pass by a young man who stops and calls after them. He turns out to be Nastenka's lover, and she jumps into his arms. She returns briefly to kiss the narrator but journeys into the night, leaving him alone and broken hearted.
The final section is a brief afterword about a letter he receives from Nastenka, in which she apologizes for hurting him and insists that she would always be thankful for his companionship. She also mentions that she will be married within a week and hopes that he will come. The narrator breaks into tears upon reading the letter. Matryona, his maid, interrupts his thoughts by telling him she has finished cleaning the cobwebs. The narrator notes that though he'd never considered Matryona to be an old woman, she looked far older to him then than she ever did before, and wonders if his own future is to be without companionship and love. He refuses to despair:
"But that I should feel any resentment against you, Nastenka! That I should cast a dark shadow over your bright, serene happiness! ...That I should crush a single one of those delicate blooms which you will wear in your dark hair when you walk up the aisle to the altar with him! Oh no — never, never! May your sky be always clear, may your dear smile be always bright and happy, and may you be for ever blessed for that moment of bliss and happiness which you gave to another lonely and grateful heart ... Good Lord, only a moment of bliss? Isn't such a moment sufficient for the whole of a man's life?"