Theory:

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 Duck and the Kangaroo":
Said the Duck to the Kangaroo,
“Good gracious! how you hop!
Over the fields and the water too,
As if you never would stop!
My life is a bore in this nasty pond,
And I long to go out in the world beyond!
I wish I could hop like you!”
Said the Duck to the Kangaroo.
 
“Please give me a ride on your back!”
Said the Duck to the Kangaroo.
“I would sit quite still, and say nothing but ‘Quack’,
The whole of the long day through!
And we’d go to the Dee, and the Jelly Bo Lee,
Over the land, and over the sea;
Please take me a ride! O do!”
Said the Duck to the Kangaroo.
 
Said the Kangaroo to the Duck,
“This requires some little reflection;
Perhaps on the whole it might bring me luck,
And there seems but one objection,
Which is, if you’ll let me speak so bold,
Your feet are unpleasantly wet and cold,
And would probably give me the roo-
Matiz!” said the Kangaroo.
 
Said the Duck, “As I sat on the rocks,
I have thought over that completely,
And I bought four pairs of worsted socks
Which fit my web-feet neatly.
And to keep out the cold I’ve bought a cloak,
And every day a cigar I’ll smoke,
All to follow my own dear true
Love of a Kangaroo!”
 
Said the Kangaroo, “I’m ready!
All in the moonlight pale;
But to balance me well, dear Duck, sit steady!
And quite at the end of my tail!”
So away they went with a hop and a bound,
And they hopped the whole world three times round;
And who so happy — O who,
As the Duck and the Kangaroo?
 
~Edward Lear
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 (2008). Honeydew. When I set out for Layonnesse - Thomas Hardy (pp. 105 - 106). Published at the Publication Division by the Secretary, National Council of Educational Research and Training, Sri Aurobindo Marg, New Delhi.
  • National Council of Educational Research and Training (2006). Beehive. The Duck and the Kangaroo  - Edward Lear (pp.94-96). Published at the Publication Division by the Secretary, National Council of Educational Research and Training, Sri Aurobindo Marg, New Delhi.