How often do you mix up your gym program?
People often speak of muscle confusion, they change up their programs frequently in order to 'confuse' the body so it will adapt to the changed stimuli.
However, frequent change to programs without giving the body time to adapt to them can be harmful for a number of reasons.
Moritani et al. Showed that lifters training for an 8 week block on a new program did not experience muscle growth for the first 3-5 weeks. They gained strength on their exercises, but this was due to neuromuscular adaptations and not muscle growth.
Momentum is also very helpful when training a movement. It helps you work towards progressive overload and prevents the loss of neuromuscular adaptations you gained over the first 3-5 weeks. Ever wondered why your bench press or squat feels much more difficult after some time away from the gym? This is one of the reasons why.
Lastly, practice! Extra time on a particular movement gives you time to practice and reflect so you can improve with each attempt. Strength and muscle mass with improve with technique as you'll get better at using the correct muscles.
So how long should you stay on a program then? I'd recommend a minimum of 2-3 months. However, make sure that you set goals before starting your program or that you at least monitor your progress. If things are still improving nicely around this mark it might be worth continuing without a change until you hit a plateau. If it ain't broken don't fix it!