One of the problems of defining “genre” is that the definition is not entirely consistent across genres.
Here’s a stab, though: (1) a work is a genre work to the extent that it includes elements of some given genre [I know I can’t use “genre” in the definition of “genre,” I’ll address this]. The more elements it has, the more it is a genre work. (2) But certain elements carry more weight than others in the assignment of the genre term, and (3) some elements that are outside the genre can mediate against the application of the term. (4) Further, the extent to which the genre elements are the focus of the story increases the genre-ness of the tale
Looking more closely at these four conditions:
(1) For example: in science fiction, the elements include things like not-yet-available technology, the future, and alternate forms of social arrangement that have not yet been tried. (2) Some examples in the first and third of these carry strong genre marks: if the work includes spaceships and a hive-like form of society, those will give it more science fiction points than if it includes only two-way wrist TVs and universal acceptance of homosexuality.
(4) If the story essentially relies upon and revolves around space travel, that is, if the story includes a trip through space and the themes of the story would vanish if the story were retold as a train-trip, then it’s going to be more strongly a science fiction story.
If a science fiction story is most centrally concerned with romance, it may be considered less of a science fiction story. Again: if Zzxrt and Krznvt fall in love on a space ship, it’s science fiction, but if you could convey nearly everything about the story by switching the setting to a train trip, it’s a romance. So it could be a science-fiction/romance, or a romance/science-fiction story.
(3) In the example above, the romance could, all by itself, detract from the science-fictioness of the story. Adding comedic elements can take away from a hard-science fiction genre ranking, but probably not eliminate it. But if your romance story is heavily imbued with goofball comedy, it probably loses some of its simple romance-genre cred. I would think that romance can only tolerate so much mocking before it is self-ejected from the genre.
Anyway, this is just a rough outline for making some larger claims about genre. I think it’s notable that I can’t define genre here without using terms like “elements of the genre,” i.e., without violating a basic rule of definition, and that’s because, as noted, each genre has its own set of conditions for admission. So to define genre properly one would probably need to list a bunch of genres and discuss their conditions of admission.
Listing the genre elements for different genres would be an interesting enterprise; for science fiction, above, I tried to be as general as possible with “not-yet-available technology, the future, and alternate forms of social arrangement that have not yet been tried.” The specific instances in these categories, though, have of course been added to over time, and some of the specific instances have become hallmarks of the genre, so that it’s probably not sufficient just to say in general what the genre conditions are. Space-ships, as noted, are more science fiction than, say, a medicine which completely relieves pain while producing no other side effects, even though we currently have space ships but we have no such medicine.
Finally, it’s important that a work can be more or less a work of some given genre. It’s not wrong to say “that’s very much a science fiction film,” or “that’s sort of science-fictiony.” The more it adheres to genre rules, the more it’s in that genre.
(Here’s a review of “Prometheus” that address some questions of genre.)