Hi, hopefully others will drop by with earlier practices, but for England/Scotland, the practice came from Norman influence. Here are a few posts on the subject
/u/Miles_Sine_Castrum in Why is it that the regnal numbers of the monarchs of England start from the Norman Conquest? For example, why is Edward I not known as Edward II and Edward the confessor known as Edward I?
/u/Valkine in If Arthur, Prince of Wales had succeeded his father Henry VII, would he have been King Arthur I or II?
/u/jetred cites a few early examples in Would George III actually have been called that during his reign, or is the number added after the fact by historians?