The mystery genre is determined by a template, that of the hidden thing revealed. Where or when you set it, who gets the revelation, what is revealed, levels of violence — create sub-genres, but they are all mysteries. As in any large, sub-genred field, some readers read only one sub-genre, but many read anything as long as it is a mystery.
One axis of splitting is who the detective is in the mystery. In the private eye mystery, starting back with Sherlock Holmes, the detective is a professional, dedicated to solving mysteries. Often the simple job like finding a missing sister, starts to accrue dead bodies and threats against the detective, who has to show their professional mettle facing the threats and solving the mystery anyway.
A sub-set of this is the hard-boiled detective mystery, where the private eye is tough, lower class or someone of a higher class who has elected to live the whiskey-drinking, dive-haunting life. Raymond Chandler’s mysteries usually are the example to point to. They are generally gritty to cruel, with violence and injuries outside of the murders almost required. Elements usually include gangsters, blackmail, rackets, drugs, and general decadence and depravity.
At the other end of the spectrum is the amateur detective who rules in the cozy mystery. The cozy will concentrate on small towns, villages, basically nice people to whom bad things are happening, perhaps because of a bad egg, old sins, or some nasty plot of outsiders. Violence is rarely on-stage and not dwelt on, though the detective may wind up facing a gun, knife, or other threat in the last scenes.
The police procedural had to wait on the police departments developing real detectives, not just beating up some of the usual suspects and hoping for a lead. These are now usually the most realistic of mysteries, with a big dose of hard-boiled elements.
A completely different axis is based on setting of the mystery.
The historical mystery has become a huge field, no small degree because police forensics so dominates actual contemporary mystery solving, especially of murders. Histmys has all the research work of writing historical fiction combined with having to use the laws and technology and philosophy of the period to pull together a mystery plot. (Yes, combinant genres are usually a lot of work to pull off well, but many of us love them, both as readers and writers.) Do I even have to mention Brother Caedfal?
Closely related is the time travel mystery, like The Devil in Velvet by John Dickson Carr. This is a way to get a modern person, with our concepts of logic and detection (starting with “no one is above suspicion”), to solve a murder back in the past. Whether the method of time travel is magic or science fiction doesn’t much matter to the mystery part, except as it may create a ticking clock that puts time pressure on the detective.
Futuristic mystery pulls in science fiction elements. Look at Isaac Asimov’s I, Robot as an example, or Jack Vance is even better, like The Many Worlds of Magnus Ridulph or Galactic Effectuator, because Vance also published straight mysteries and very well knew what he was doing. More of you are familiar with the J. D. Robb/Norah Roberts Eve Dallas mysteries. I tend to hold these up as bad examples. The mysteries are good, but this represents what often happens when people who are competent in one field of writing don’t bother to start over as learners in another. So many mainstream writers think they can just toss off some science fiction, and they build silly worlds like this, with fully functional colonies on planets in other solar systems, only a day’s travel away, in the mid 21st century, and, my pet peeve, flying cars. Just like histmys, futurmys requires all the work of good science fiction with all the structure and fan-dancing of a good mystery.
Now I’m sure you can see that Eve Dallas is a future police procedural, while the Star Princes novels by Vance are future hard-boiled detective, and The Devil in Velvet is an amateur histmys not at all cozy. So mysteries can subdivide on more than one axis at a time.