In the prohibition of a Kohen marrying a Zonah (cf. Vayikra 21:7), what defines a woman as a Zonah? Is it just having had relations with a non-Jew, or does it also include having relations out of wedlock?
The Rambam (Issurei Biah 18:1) defines a Zonah thus:
מפי השמועה למדנו שהזונה האמורה בתורה היא כל שאינה בת ישראל, או בת ישראל שנבעלה לאדם שהיא אסורה להנשא לו איסור השוה לכל, או שנבעלה לחלל אע"פ שהיא מותרת להנשא לו
From a tradition we have learned that the Zonah described in the Torah is any woman who is not a Jew [lit. "daughter of a Jew"], or a Jew who had sexual relations with a man to whom she was prohibited to marry [Nissuin] by a prohibition which applies to all, or if she had sexual relations with a Challal [progeny of a Kohein and a woman who is forbidden to him] even though she is permitted to marry him.
The Shulchan Aruch rules this way nearly word for word in Even HaEzer 6:8.
This legalistic wording is meant to clarify the following cases:
A convert or a freed Canaanite maidservant are Zonot in all cases because they didn't start out Jewish.
A woman who had relations with an animal is not a Zonah because she didn't have relations with a man to whom she was prohibited to marry etc.
A woman who had relations while being a Niddah or as a prostitute (to an otherwise kosher man) is not a Zonah because the man having relations with her can still marry her.
A woman who is a widow and had relations with a Kohein Gadol does not become a Zonah because that prohibtion (Kohein Gadol to widow) is not one that applies to all.