The golden rule of repetition is three. It’s like ice cream. The first scoop you eat and delight in. The second scoop is still yummy, but somehow not so much. The third scoop all of a sudden makes you want to gag. Nothing changed, right? The ice cream is the same. What changed is your perception. Too much of a good thing can make you sick.
Same with writing.
There are times when you should avoid repetition altogether (if you want to make a strong impact) and times when you need repetition to drive the message home (if you want to convey a truth that’s hard to swallow).
The thing is, we love repetition. There is comfort in it and rhythm. If it’s done right. How to do it?
Limit it to three.
Examples are everywhere, from novel structure (12 Columns and other methods), to scene blocking, to lines of dialogue. Especially in dialogue, the emotions you convey must constantly vary.
If your character says a joke, and then the same joke again right after, the second time around the effect will be diminished. The third time it'll be lost. But if you vary it just slightly, the effect will multiply and hit home on the third repetition.
Say, your character is doing self-loathing. “I’m bad. I can’t believe how bad I am. I'm so bad, I want to drive my head through the wall!” See how I milked the word “bad” to the maximum? If I say it the fourth time, I’ll kill it. And if I limit it to two, it won't be quite enough. But three times is just right.
Notice this rule of three as you consume stories, and steal that structure for your own writing.