The child would not be a mamzer.1 Why? Because there are two kinds of forbidden relationships:

1. Relations between those who are forbidden to one another, but could, technically, become married by Torah law. For example, a kohen with a divorcee—they are not allowed to marry, but if they did, the marriage would be legitimate and they would be required to divorce. The child born of a relationship between two such people is not a mamzer.

2. Relations between those who cannot be bonded in marriage. For example, a brother and sister. Even if they were married under the supervision of the chief rabbi with the most impeccable witnesses and only later would it be discovered that they are brother and sister, the marriage never happened, it is entirely invalid. A child born of such a relationship is a mamzer.2

Since, by Torah law, a man can technically marry more than one woman, the relation of a married man with an unmarried woman is of the first sort. Since, by Torah law, a woman can only be married to one man, the relation of a married woman to any man other than her husband is of the second sort.

Of course, polygamy is not practiced among Jews, but this does not affect the technicalities mentioned.

Rabbi Tzvi Freeman for Chabad.org