There's urban fantasy, set in contemporary times in the world as we know it, but with characters becoming infused with superpowers, utilizing magic, or discovering that magical creatures exist. Neil Gaiman has written many urban fantasies, such as American Gods, Neverwhere, and Anansi Boys.
Consider the more standard fantasy novel: set in an unspecified time, but typically seems medieval; set in our world or something like it; involving knights, dragons, warring kingdoms, royalty, and other fairy-tale elements; and a sense of propriety and etiquette, customs and traditions. I would place the lovely Stardust by Neil Gaiman in this section.
Then there are fantasy stories regarded as classics. I tend to like those written in the Victorian era. Some may employ fairy tale elements. Many tred the mythology path: a character, typically a child, loses his or her way and is helped along by various characters, both good and evil. I have a penchant for Alice's Adventures in Wonderland and Through the Looking-Glass and What Alice Found There by Lewis Carroll. (I will never tire of these books. Ever.)
What about classics like The Time Machine, you ask? Once a book involve inventions, technology, and other science bits, I tend to categorize it as science fiction. What about War of the Worlds? Spaceships and aliens also fall under the heading of science fiction for me. There are plenty of sci-fi sub-genres, but that's another post. The line between fantasy and sci-fi can be blurry, and I like the view. I don't like when people make rash generalizations. I can really break it down, if you insist: Dragons? Fantasy. Robots? Sci-fi. Dragon robot? Both - and, if it's kind and intelligent, may I please have one?
There are modern fantasy classics as well, distinguished as such because we are no longer in the decade in which they first hit bookshelves, but we are still within fifty-odd years of their publication. The NeverEnding Story by Michael Ende. Many of Madeleine L'Engle's works.
Some people are quick to call a newly-released book "an instant classic," a turn of phrase I dislike. I would prefer to say something was "destined to be a classic," because it cannot already be a classic if it just came out last week. (It should be noted that I resisted the urge to place that last phrase in bold type.)
I really could go on and on about this genre, but for now, I'll wrap this up, then create a separate post for the YA fantasy booklist which Kiba requested.