Refrain is a type of repetition found in poetry. In this type of repetition, a phrase, a line, or lines are repeated instead of a word.
Pronunciation Guide  
Refrain-- re (as in "remember")-- fra (as in "phrase")-- in (as in "pain")
In a refrain, a line can be repeated either with lines in between or not. Let us take the following poem by David Bates as an example:
Example:
Speak gently! – It is better far
     To rule by love, than fear
Speak gently– let not harsh words mar
     The good we might do here!
 
Speak gently! – Love doth whisper low
     The vows that true hearts bind;
And gently Friendship’s accents flow;
     Affection’s voice is kind.
 
Speak gently to the little child!
     Its love be sure to gain;
Teach it in accents soft and mild:-
     It may not long remain.
 
Speak gently to the young, for they
     Will have enough to bear –
Pass through this life as best they may,
     ‘T is full of anxious care!

Speak gently to the aged one,
       Grieve not the care-worn heart;
The sands of life are nearly run,
      Let such in peace depart!
 
Speak gently, kindly, to the poor;
      Let no harsh tone be heard;
They have enough they must endure,
     Without an unkind word!
 
Speak gently to the erring – know,
     They may have toiled in vain;
Perchance unkindness made them so;
     Oh, win them back again!
 
Speak gently! – He who gave his life
     To bend man’s stubborn will,
When elements were in fierce strife,
     Said to them, ‘Peace, be still.’
 
Speak gently! – ’tis a little thing
     Dropped in the heart’s deep well;
The good, the joy, which it may bring,
     Eternity shall tell.
"Speak gently" is the refrain in the poem. It is repeated constantly throughout the poem, with intervals (or lines in between). 
 
Refrain can appear anywhere in the poem, with or without the intervals. It can appear at the beginning of the stanzas like the above example. It can also appear at the end, like the one seen in the poem "Stopping by Woods on a Snowy Evening" by Robert Frost.
Example:
Whose woods these are I think I know.  
His house is in the village though;  
He will not see me stopping here  
To watch his woods fill up with snow.  
 
My little horse must think it queer  
To stop without a farmhouse near  
Between the woods and frozen lake  
The darkest evening of the year.  
 
He gives his harness bells a shake  
To ask if there is some mistake.  
The only other sound’s the sweep  
Of easy wind and downy flake.  
 
The woods are lovely, dark and deep,  
But I have promises to keep,  
And miles to go before I sleep,  
And miles to go before I sleep.
The above poem is also an example to show that the lines can be repeated immediately without intervals.
According to J.A.Cuddon, refrain is "a phrase, line or lines repeated at intervals during a poem and especially at the end of a stanza". 'Very often it is an exact repetition but sometimes it will undergo a slight modification'. 
As Cuddon pointed out, refrain can also happen with modification. Let us take the following poem "Disdain me Not" by  Sir Thomas Wyatt as an example:
Example:
Disdain me not without desert,
Nor leave me not so suddenly;
Since well ye wot that in my heart
I mean ye not but honestly.
Disdain me not.
 
Refuse me not without cause why,
Nor think me not to be unjust;
Since that by lot of fantasy
This careful knot needs knit I must.
Refuse me not.
 
Mistrust me not, though some there be
That fain would spot my steadfastness;
Believe them not, since that we see
The proof is not as they express.
Mistrust me not.
 
Forsake me not till I deserve
Nor hate me not till I offend;
Destroy me not till that I swerve;
But since ye know that I intend,
Forsake me not.
 
Disdain me not that I'm your own:
Refuse me not that I'm so true:
Mistrust me not till all be known:
Forsake me not ne for no new.
Disdain me not.
The above contains several other types of repetitions as well. However, what is to be noted here is that this poem contains two sets of refrains.
 
The first set of refrains can be seen in the individual stanzas. Each stanza has a refrain that appears in the beginning and the end. For example, the second stanza contains the refrain "refuse me not" at the beginning and in the end.  
The second set can be seen in the poem as a whole. Throughout the poem, the phrase "disdain me not" is repeated with modification. Words such as refuse, mistrust, and forsake are used as modifications here.
Hence, if a line or a phrase is repeated, it is called a refrain.
Refrain from the poem "The Tale of Custard the Dragon":
Belinda lived in a little white house,
With a little black kitten and a little grey mouse,
And a little yellow dog and a little red wagon,
And a realio, trulio, little pet dragon.
 
Now the name of the little black kitten was Ink,
And the little grey mouse, she called him Blink,
And the little yellow dog was sharp as Mustard,
But the dragon was a coward, and she called him Custard.
 
Custard the dragon had big sharp teeth,
And spikes on top of him and scales underneath,
Mouth like a fireplace, chimney for a nose,
And realio, trulio daggers on his toes.

Belinda was as brave as a barrel full of bears,
And Ink and Blink chased lions down the stairs,
Mustard was as brave as a tiger in a rage,
But Custard cried for a nice safe cage.
 
Belinda tickled him, she tickled him unmerciful,
Ink, Blink and Mustard, they rudely called him Percival,
They all sat laughing in the little red wagon
At the realio, trulio, cowardly dragon.

Belinda giggled till she shook the house,
And Blink said Weeck! which is giggling for a mouse,
Ink and Mustard rudely asked his age,
When Custard cried for a nice safe cage.
 
Suddenly, suddenly they heard a nasty sound,
And Mustard growled, and they all looked around.
Meowch! cried Ink, and ooh! cried Belinda,
For there was a pirate, climbing in the winda.

Pistol in his left hand, pistol in his right,
And he held in his teeth a cutlass bright,
His beard was black, one leg was wood;
It was clear that the pirate meant no good.
 
Belinda paled, and she cried Help! Help!
But Mustard fled with a terrified yelp,
Ink trickled down to the bottom of the household,
And little mouse Blink strategically mouseholed.

But up jumped Custard, snorting like an engine,
Clashed his tail like irons in a dungeon,
With a clatter and a clank and a jangling squirm,
He went at the pirate like a robin at a worm.
 
The pirate gaped at Belinda’s dragon,
And gulped some grog from his pocket flagon,
He fired two bullets, but they didn’t hit,
And Custard gobbled him, every bit.
 
Belinda embraced him, Mustard licked him,
No one mourned for his pirate victim.
Ink and Blink in glee did gyrate
Around the dragon that ate the pirate.
 
But presently up spoke little dog Mustard,
I’d have been twice as brave if I hadn’t been flustered.
And up spoke Ink and up spoke Blink,
We’d have been three times as brave, we think,
And Custard said, I quite agree
That everybody is braver than me.
 
Belinda still lives in her little white house,
With her little black kitten and her little grey mouse,
And her little yellow dog and her little red wagon,
And her realio, trulio little pet dragon.
 
Belinda is as brave as a barrel full of bears,
And Ink and Blink chase lions down the stairs,
Mustard is as brave as a tiger in a rage,
But Custard keeps crying for a nice safe cage.
~ Ogden Nash
    Reference:
  • State Council of Educational Research and Training (2019). Term-1 English Standard-7. Your Space by David Bates (pp. 70-72). Published by the Tamil Nadu Textbook and Educational Services Corporation.
  • https://www.poetryfoundation.org/poems/42891/stopping-by-woods-on-a-snowy-evening
  • https://allpoetry.com/Disdain-Me-Not
  • Cuddon, J.A. A Dictionary of Literary Terms and Literary Theory. West Sussex, Wiley-Blackwell Publication, 2013.
  • National Council of Educational Research and Training (2006). Beehive. The Tale of Custard the Dragon - Ogden Nash (pp. 129-132). Published at the Publication Division by the Secretary, National Council of Educational Research and Training, Sri Aurobindo Marg, New Delhi.