Let's first review some relevant sources then try and answer your multiple questions.
To start with it is clear a mechitza is required in a shul when people pray. R Chaim Navon writes
Here the solid, unequivocal and consistent custom in all Jewish
communities is that there should be a mechitza in the synagogue during
prayer times. Jewish prayer is conducted in the framework of total
separation between men and women. No halakhic authority challenges the
obligation to have a mechitza.
R Daniel Mann at Eretz Hemda writes
It is agreed that regarding davening in a place that is not
set for tefilla, the formal requirement of mechitza per se does not
exist. This is more obvious in a public place, like a plane. The need
for a mechitza is more of an obligation to put one in the proper place
than a prohibition to daven without it. Therefore, since there is no
way to expect an airline servicing Jews and non-Jews to put up a
mechitza, there is no problem. Even in places like sheva berachot and
a shiva house, there is not a formal need for a mechitza (see Igrot
Moshe OC I:39 and V:12).
He specifically writes that a shul itself elevates the level of sanctity and requires a mechitza but sees a kula if only one or two women are there
If men are davening in a shul at a time when there is no minyan, it
would seem that a mechitza is needed if women are present (one or two
women are likely not a problem (see ibid.; Ishei Yisrael 9:28)). After
all, they are davening and the shul has sanctity that elevates tefilla
even without a minyan (see Shulchan Aruch, OC 90:9).
(see at the end there for further guidelines)
R Chaim Navon here quotes R Moshe Feinstein that a mechitza is there to prevent mingling, not visual separation. As such it is possible that a very large room would not require a mechitza if women are far enough that distance prevents mingling.
The mechitza in the Temple was meant to prevent mingling that involves
levity, and not necessarily visual separation. So too writes the
Rambam (cited above) regarding the need for a balcony in the Temple:
“So that they would not mingle.” Rav Feinstein therefore rules that a
shoulder-height mechitza suffices, as it provides enough separation to
prevent the mingling of men and women during the prayer service.
Finally R Yehuda Henkin in Responsa on Contemporary Jewish Women's Issues p. 124 writes
Outside of a synagogue a mechitza is mandatory when two conditions
are met: first both the men and the women intend to participate in the
prayers, and second, the place is being used at the time solely for
prayer [...] where these conditions do not apply, a mechitzah is not
required. For this reason no mechitzah is required in a wedding hall
when a minyan of men gather in one corner, both because the women do
not participate and the hall is not being used exclusively for prayer.
So to answer your questions
Is this only in a shul (synagogue) or anywhere men are praying?
Only in a shul
Is there a minimum amount of women present to require a mechitza?
If there is a large shul with one woman present, may the men daven there, or must she leave first?
According to R Mann, one woman is not an issue assuming she doesn't mingle with the men.
Is there any distance criteria?
If the shul is very large, and the men are only way up-front and there are a few women all the way in the back, is that ok?
According to R Navon and R Henkin it should be OK, if there is no mingling, the women do not participate in the prayer and the place is not used only for prayer at that time.
In a public area, like in an airport or at a wedding hall, must there be no woman at all in the whole room in order for the men to be allowed to daven?
As we have seen, this is not a requirement. Men can daven in an area of the hall.
Does it make any difference whether the women are also davening or not?
It does: if women daven R Henkin requires a mechitza.
See also here, here for further discussions and alternative approaches.