I doubt there is actually any hard law about a Timelord changing things that have occured in his own or a companion's timeline. At least, by the time of the ninth and tenth Doctors there is no one to up hold such a law. More likely The Doctor loosely lives by this sort of rule to prevent paradoxes, as well as to keep from potentially making any situation worse than it was when he started/left.
Take for example the companion Rose Tyler. The Doctor agreed to take Rose to witness her father's death. Not just once even, but twice. The second time of course Rose breaks time and paradoxes ensue. I can not recall any episodes after this in which The Doctor took a companion across their own past timeline, so perhaps this was when The Doctor decided doing this was a bad thing (for humans at least).
However, The Doctor himself has been happy enough to cross his own time as it suits him, or when he is desperate enough. In the first episode with Martha Jones the tenth Doctor crosses his own timeline to visit Martha on the street before she meets him in the hospital. Another example, in The Big Bang The Doctor crossed his own path in the museum. This was rather dire circumstance with the fate of the universe on the line, after which the universe was rebooted and any damage to time was effectively re-written.