A genre is a type of artistic work. It is partly defined by the style of the portrayal, and can also by influenced by the type of content. So, some genres are primarily about the way the work is constructed -- for example, as a novel for reading over more than one sitting or as a play to be enacted and watched in a couple of hours or less. And other genres are closely tied to a particular subject matter. For instance, the structure of a mystery is usually quite different from a biography. Though sometimes the author may violate the paradigm of the primary genre for effect. Examples of this are when an actor steps out of role to interact with the audience of a play, when what seems to be a straight forward telling of a story arrives at a mysterious twist, or when the scary music plays in the background of a movie, but nothing bad happens.
Here is an interesting infographic that explains the types of genres in literature.