In the time of King Herod, after Jesus was born in Bethlehem of Judea, wise men from the East came to Jerusalem,
(Mat 2:1 NRSV)
The Greek word for “wise men” is magoi, the plural of magus. It may read “magi”, “kings”, or “wise men,” depending on your translation. The word is usually more closely associated with magic than royalty or wisdom, so magi seems the most accurate. Gingrich’s Lexicon says it can mean “wise men” or “astrologers.” Friberg’s Lexicon says it refers to the high priestly caste of Persia. Thayer’s Lexicon says it was a name the Babylonians, Medes, and Persians used to refer to “wise men, teachers, priests, physicians, astrologers, seers, interpreters of dreams, augurs, soothsayers, sorcerers etc.” (Thayer’s Greek Lexicon, entry 3280 magus).
Herodotus, an ancient Greek historian, uses it in a more neutral way for “one of a Median tribe” (Liddell-Scott, Greek Lexicon (Abridged)). For an example of how it is used in the Old Testament, we have this from the book of Daniel. The Babylonian king Nebuchadnezzar had a disturbing dream, so he did what all kings did back then: He called in his experts to help him interpret the dream.
So the king commanded that the magicians, the enchanters, the sorcerers, and the Chaldeans be summoned to tell the king his dreams. When they came in and stood before the king,
(Dan 2:2 NRSV)
In the Septuagint, magus translates the Hebrew ‘ ashaph, which corresponds with “enchanters” in this translation. The reference to the Chaldeans could connect it to the “Medians” per Herodotus. The BDB lexicon defines it as a “conjurer, [or] necromancer,” and says it is probably a loan word from the Babylonian asuipu. All of the categories listed probably had some connection with magic and/or astrology, and they are advisors to the king. We could probably guess the magi in the Nativity story are the same. It is clear that they practiced astrology, because the appearance of a star prompted their journey.
In the Book of Acts, magi include Simon Magus (8:9–11), Bar Jesus (13:6), and Elymas (13:8), all of them villains. However, they would not have had the same status as Median or Persian magi in the court of the king. Given what Persian religion was, they might have been priests, as Friberg and Thayer said. There is an old image of the magi wearing caps shaped like cornucopias that identify them as priests of Mithras. Though it is dated several hundred years later, it is a possibility.