Attempting to find a distinguishing characteristic that can be universally applied across sexually reproducing organisms is challenging! But, biologically speaking, the distinction is quite simple—sexes can be distinguished, across the board, by gamete (or sex cell) size.
Some sexually reproducing organisms are isogamous, meaning they produce the same size gametes, and some are anisogamous, meaning they produce different size gametes. Isogamous organisms include species of fungi, algae and protozoa; some of these organisms have between 2 and thousands of “mating types” that can be thought of as sexes. But they aren’t male and female.
Sexually reproducing anisogamous species generally have only two sexes. So how do we distinguish the males from the females? Scientists have created a definition of female that includes all the individuals that produce large gametes (eggs), those that produce small gametes (sperm) are male. This large gamete/small gamete distinction between males and females is the only one that holds up well across many sexually reproducing species.
While sexually reproducing plants and animals generally have only two sexes, our ability to define individuals biologically as one sex or the other is complicated by our growing understanding of the sex varieties that exist. You can read here about some fascinating examples of our changing understanding of sex (https://www.nature.com/news/sex-redefined-1.16943).