Mystery - A work of fiction, a drama, or a film dealing with a puzzling crime.
(2003, American Heritage Dictionary. Houghton Mifflin Company)
There are a number of sub-genres within the broad category of mystery/detective/crime fiction. They overlap and are open to subjective interpretation. Some of the widely recognized categories are:
Standard Private Eye. Writers include Ross Macdonald, Walter Mosley, Sara Paretsky, and Robert B. Parker. Some of these are hard -boiled (see below), some are "soft-boiled," featuring more psychology and less action. The PI typically has a license to practice and collects a fee.
Cozy Mysteries. This style features minimal violence, sex, and social relevance; a solution achieved by intellect or intuition rather than police procedure, with order restored in the end; honorable and well bred characters; and a setting in a closed community. Overlaps with the Classic Detective category, below. Check out Helen Androski's "Cozies: A Selective List." Writers include Agatha Christie, Dorothy L. Sayers, and Elizabeth Daly.
Classic Detective. Sometimes called the old-fashioned detective story, this sub-genre was at its height in the 1930s. It generally features a mysterious death, a closed circle of suspects who all have motives and reasonable opportunity to commit the crime. The central character is the detective who, by logical deduction from the facts in evidence, solves the mystery. Overlaps with the Cozy Mysteries category, above. Writers include Agatha Christie, Arthur Conan Doyle, Patricia Wentworth, and John Dickson Carr.
Police Procedurals. In the 1940s the police procedural evolved as a new style of dectective fiction. Unlike the heroes of Christie, Chandler, and Spillane, the police detective was subject to error and was constrained by rules and regulations. As Gary Huasladen says in Places for Dead Bodies, "not all the clients were insatiable bombshells, and invariably there was life outside the job." The detective in the police procedural does the things police officers do to catch a criminal. Writers include Ed McBain, P. D. James, and Bartholomew Gill.
Hard-Boiled. In his biography Ross Macdonald Matthew J. Bruccoli describes hard-boiled literature as "realistic fiction with some or all of the following characteristics--objective viewpoint, impersonal tone, violent action, colloquial speech, tough characters, and understated style; usually, but not limited to, detective or crime fiction." Writers include Raymond Chandler, John D. MacDonald, Sue Grafton, and Bill Pronzini.
Thrillers. Thrillers have a basic set of structural components, such as threats to the social order, heroes and villains, and deduction and resolution. Many thrillers are also mystery or detective stories. Examples are Patricia Highsmith's Ripley novels and novels by Robert Ludlum.