On the boat on chapter 21, Victor dreams that
I felt the fiend’s grasp on my neck and could not free myself from it; groans and cries rang in my ears.
But more important is Victor's reaction:
My father, who was watching over me, perceiving my restlessness, awoke me; the dashing waves were around, the cloudy sky above, the fiend was not here: a sense of security, a feeling that a truce was established between the present hour and the irresistible, disastrous future imparted to me a kind of calm forgetfulness, of which the human mind is by its structure peculiarly susceptible.
Victor feels "calm" after this dream: this is an important change in him as he has been frenzied for a long time. This calm signals acceptance of what is to come, a sense of accepting the inevitability of disaster.
In chapter 23, after the monster kills Elizabeth and, as a result, Frankenstein's father—unable to bear the horror any longer—dies in his son's arms, Frankenstein has a recurrent dream:
Sometimes, indeed, I dreamt that I wandered in flowery meadows and pleasant vales with the friends of my youth, but I awoke and found myself in a dungeon.
Following this interlude of madness and misery, Frankenstein undergoes another change. He tells us that his reason returns and, with it, a desire for revenge. He may have had happy dreams of his youth, but he now also has a harsher purpose: that of finding and destroying his creation.
As he pursues the monster, his dreams become a sustaining force:
O blessed sleep! Often, when most miserable, I sank to repose, and my dreams lulled me even to rapture.
He dreams of the past and his friends and family who have died. These dreams provide a counterbalance to his present misery and the energy to keep on in his quest to destroy the monster:
Often, when wearied by a toilsome march, I persuaded myself that I was dreaming until night should come and that I should then enjoy reality in the arms of my dearest friends.
Thus we see that dreams and nightmares help Frankenstein change and refortify himself in ways that allow him to deal with reality.
There are two places in Mary Shelley's novel Frankenstein where dreams affect Victor's character. The first dream comes after Victor has succeeded in creating life, while the second dream comes as Victor and his father are on their way home from Ireland.
In chapter five, after bringing the Creature to life, Victor dreams of Elizabeth. In this dream Victor is embracing Elizabeth and she turns into his deceased mother, Caroline.
I slept, indeed, but I was disturbed by the wildest dreams. I thought I saw Elizabeth...her features appeared to change, and I thought that I held the corpse of my dead mother in my arms.
Here, the nightmare Victor has foreshadows the death of Elizabeth.
Later, in chapter twenty-one, Victor, on his way home from Ireland, dreams that the monster has come to make good on his promise to end Victor's life.
Towards morning I was possessed by a kind of nightmare; I felt the fiend's grasp in my neck, and could not free myself from it; groans and cries rung in my ears.
Here, Victor dreams about dying in the same way both William (his brother) and Henry (his best friend) died--by strangulation. This not only speaks back to the deaths of both, it foreshadows the fact (for Victor) that the Creature will see him again on his wedding night.