It was first mentioned in Tom Baker's The Deadly Assassin, to give a reason why The Master was after the Eye of Harmony (to extend his lifetime).
From Wikipedia:
It is first stated in The Deadly Assassin (1976) that a Time Lord can regenerate twelve times before dying (thirteen incarnations in all). There are exceptions to this rule....
http://en.wikipedia.org/wiki/Regeneration_(Doctor_Who)