When it comes to lyrics, the term is epistrophe. Synonyms are anistrophe and epiphora.
The repetition of the same word or words at the end of successive phrases, clauses or sentences.
I haven't found any solid evidence of the term's use in a melodic or harmonic context (though Thelonius Monk's "Epistrophy" might offer a clue).
When the repetition occurs at the beginning of a phrase, it's called Anaphora.
The repetition of a phrase at the beginning of phrases, sentences, or verses, used for emphasis.