Good question, there is an entire book dedicated to your question: What Is A Chemical Element? A Collection of Essays by Chemists, Philosophers, Historians, and Educators, 2020, published by the Oxford University Press.
The concept of a chemical element is foundational within the field of
chemistry, but there is wide disagreement over its definition. Even
the International Union for Pure and Applied Chemistry (IUPAC) claims
two distinct definitions: a species of atoms versus one which
identifies chemical elements with the simple substances bearing their
names. The double definition of elements proposed by the International
Union for Pure and Applied Chemistry contrasts an abstract meaning and
an operational one.
You may wish to get hold of this book!
At one time, element was a substance that resisted further analysis, i.e., it was impossible to break it down into simpler substances. This implied classical chemical analysis. For example, if we chemically try to break down the Fe atom by heating in an ordinary laboratory, it will be an unsuccessful attempt. The substance after heating at laboratory temperatures followed by cooling will still behave the same.
IUPAC modernized this definition, by stating that A species of atoms; all atoms with the same number of protons in the atomic nucleus. It is a collective and a comparative label for a group of atoms.
As an example, if we isolated an argon atom from a bottle of argon gas, we could not conclude that it was an element without counting and comparing its protons with those from other atoms in the bottle. In that bottle, if we find that all atoms have 18 protons, we can label it as an argon gas, since each atom has 18 protons.
Now coming to your main question: What about Fe vs. $\ce{O2}$. Iron is clearly an element by elementary definitions. You can say that $\ce{O2}$ is a molecule formed by two identical chemical elements, called oxygen.
However, now in everyday parlance, we can say that many elements exist as molecules in nature but not as free atoms like Ne, Ar, Kr, Xe. For example the element sulfur exists as $\ce{S8}$, the element called oxygen exists as a diatomic molecule $\ce{O2}$. The element are oxygen and sulfur atoms but in nature they exist as molecules. If someone gives a solid yellow piece of sulfur in your hands, colloquially, we might say that we are holding the element sulfur, but in effect the actual referal is to individual sulfur atoms, regardless of the fact that the atoms are chemically bonded to each other.