Caspar,Balthazar, and Melchior are names given the Three Kings aka The Magi, in my Catholic School

Does anybody know where these names comes from? Since the Magi in the Gospel are both numberless and nameless, who decided that there were three of them, and that they were called C(G)aspar, Balthazar, and Melchior? Is this just a case of some ancient reading his kid a story , and being pestered,"But Dad, what were their names?"