Matthew, the only gospel of the four Canonical gospels to mention the Magi, does not mention their number. Many traditions say there were three, presumably because of the three gifts. The Syriac churches, on the other hand, number them twelve. What is the basis for number 12?
The basis for the belief that there were twelve Magi (or more) is a very obscure, apocryphal manuscript called The Revelation of The Magi that was discovered in a Turkish monastery in the 18th century.
Brent Landau has published a dissertation on the subject: The Sages and the Star-Child: An Introduction to the Revelation of the Magi, An Ancient Christian Apocryphon
From Landau's summary and introduction to the text:
It is also worth mentioning that the list of the names of the twelve Magi and their fathers in Rev. Magi 2:3 is found in works by a number of other Syriac writers. However, the names from this list are never referenced again in the narrative of Rev. Magi, and they are so widespread throughout Syriac literature that they are likely not to have originated in Rev. Magi, but instead were added to the text at some point after its creation. Indeed, there are hints scattered throughout Rev. Magi that the Magi constituted a group much larger than twelve: the text uses the Syriac term mashritha to describe them on several occasions, a word used in the Syriac NT to translate the Greek parembolos, used almost exclusively for large assemblies of people (e.g., Acts 21:34; Heb 11:34, 13:11). (4, emphases added)