As far as I know, during the Middle Ages it was rare for a lowly king to use an official number. For all that I know, there might have been kingdoms where no king ever officially used a number before the end of the Middle Ages.
During the Middle Ages the official use of regnal numbers was mostly limited to the Emperor and the Pope. And I don't know when or where the first official use of regnal numbers was.
Wikipedia has an article "Pope John numbering" about the problems with the numbering of popes and anti popes named John.
One problem began when medieval historians came to believe there were three Pope Johns between 983 and 996 instead of two consecutive Pope Johns, now numbered John XIV and John XV.
When Pedro Julaio was elected Pope in 1276 he selected the name and number John XXI instead of John XX for himself because he believed in the imaginary Pope John XIVb.
So this shows that the practice of number popes began by 1276. But if the real popes John XIV and John XV used official numbers in 983-984 and in 985-996, wouldn't later historians have realized there wasn't any pope John between them?
So I guess, but don't know, that the practice of numbering popes began sometime between 996 and 1276.
In eurulers, the earliest use of a number by an emperor in his title is by Emperor Otto "The Wonder of the World", son of Emperor Otto "The Red", son of Emperor Otto "The Great" in 1001.
Otto tercius divina favente clementia Romanorum imperator augustus nec non