Has the limit on regenerations for Time Lords shown in The Time of the Doctor always been canon, or was this was made up just for this episode?
The canon limit is from the Fourth Doctor (Tom Baker) in The Deadly Assassin and was recently changed / modified In The Time of the Doctor.
"The Time Lords gifted the Doctor a new cycle of regenerations. He then proceeded to control the regenerative energy gifted to him and shoot down the Daleks with it, destroying many ships in huge blasts of energy. This however may only be used after receiving a new cycle of regenerations."
RE: The Deadly Assassin:
This is the first story to reference the fact that Time Lords get 12 regenerations and 13 lives. Recent interviews with the production team behind the 2005-present revival (including David Tennant in Doctor Who Magazine #415) have made it appear as if the allocation of 13 lives in this story is a piece of minutia unique to this story. In fact, the 13-life limit has been a major plot element of at least three other stories, both of which involve villains attempting to steal the Doctor's remaining regenerations: TV: The Keeper of Traken, TV: Mawdryn Undead and the 1996 TV movie. All of these stories reference the 13th life limit in dialogue. Several other Time Lords have been encountered since The Deadly Assassin in later stories who have reached their 13th and final incarnation, namely Azmael and Salyavin.
Yeah, it was confirmed years ago in a classic Tom Baker episode, the Deadly Assassin. The Master tried to regenerate a 13th time, but he somehow lived through (a regular Time Lord would've died) it, probably because "only hate keeps him alive". But's that heavily implied to be the reason why he was a rotting, walking corpse at that point.