I was reading some PhD guidelines and happened to come across a very meaningful remark. I felt exciting and decided to copy the inspiring paragraph here.
. . . more than you have to. For many, teaching is attached to a stipend or is otherwise economically unavoidable. In this case, do what you must! Moreover, there are some real intellectual and practical advantages from doing a couple of terms of TA work. Explaining the concepts to others is very useful in consolidating them in yourself. But beyond this, the returns become strongly negative. Your job is research – and anything that distracts you from this is a heavy cost. The first cost, which may seem remote at the time that you are deciding on the teaching, is that it could delay completion of the thesis by a year or more. An even larger cost is if it crowds out time to write a really great thesis. As a PhD student, your time is very valuable; treat it that way.