Sexes (male and female) are generally defined in terms of Anisogamy, which means that there are size differences between the gametes (i.e. the reproductive cells that fuse at fertilization). The sex with smaller gametes is defined as male and the sex with larger gametes is defined as female, and individuals that can produce both types of gametes are called hermaphrodites. This is the case in both animals and plants (plants have pollen vs. ovules and microsporangia vs. megasporangia), and the definition of sexes is therefore not dependent on chromosomal makeup as such or which sex that carries the young. Actual sex determiniation in a particular species is often based on chromosomal inheritance though, but other systems also exists (e.g. environmental cues or sequential hermaphroditism). Anisogamy also comes in several different types, where animals generally have Oogamy, where males have small mobile spermatozoa and females large stationary egg cells.
More generally, Anisogamy is a special case of mating types in sexually reproducing organisms, where fertilization (on syngamy) generally can only occur between gametes of different mating types. In for instance fungi, gametes of different mating types are of the same size (isogamous) and they are therefore only labelled as mating types (e.g +/-) and not different sexes. Functionally, if we are simplifying the issue, male gametes can be viewed only as carriers of genetic information, while female gametes also contain the nutrients necessary for the early development of a newly formed embryo.