The tension in the rope is constant if its force does not have to be used to accelerate anything else, including itself. Therefore, if it has negligible mass and is held taut between two points, the tension will be considered constant throughout.
If there is a knot in the rope but the rope is straight and has a negligible mass, the tension will still be constant throughout.
If the rope is kinked at some point, though,and head off in different directions from the kink, then the tension may change so that the kink point is held in equilibrium. This constitutes the rope changing direction at one distinct point. This is common in static equilibrium problems where objects are held up by ropes, or a tightrope walked (for example) is standing on the rope in what we consider to be one spot.
However, if the rope is wrapped around a frictionless, massless pulley, it does not change direction at one sharp point. It changes direction continuously, in infinitesimal small increments. At any point, though, the tension vectors are essentially equal and opposite, so the tension is considered to be constant as the rope wraps around the pulley.
But if the pulley has mass (or friction), it takes some force to accelerate, and that force comes from the rope, so the rope changes tension as it wraps around the pulley, giving some of its force to accelerate the pulley as the system moves (of course, if it is stationary, the tension would not change, even around a massive pulley).