Time Lords can only regenerate twelve times. However, when a Time Lord's thirteenth body starts to die, an automatic regeneration attempt will occur. In "The Twin Dilemma" Azmael attempts to regenerate a thirteenth time, but dies instead. (As he intended; it was his way of committing suicide.)
BTW, at Lake Silencio, it wasn't REALLY the doctor. It was the Teselecta, and the "regeneration" was just a "light show".
(It is explained in the BBC novels, that The Master attempted a thirteenth regeneration, but rather than die ended up in his "The Deadly Assassin" form.)