It depends on when you ask the question. Prior to May 6, 2015, the answer was "way too many for anyone to count". After that, it was "about 5."
As far as I know, no one has ever sat down and counted all of the universes that exist in the Marvel (and associated) worlds. The reason is that new universe "numbers" are assigned for several different reasons, and they are not all on equal footing. The Marvel Wikia lists around 1500, including quite a few unofficial ones, but not including temporary universes (which never got a number), and that list is probably incomplete.
Technically, as of right now, there are very few Marvel universes. The recently released Secret Wars (the 2015 one, not to be confused with the one from 1984) event has effectively erased all numbered comic-book universes from existence, leaving only Battleworld. Once that event series is over, in theory there will only be 1 comics universe.
Note that the cinematic universes are unaffected by Secret Wars, meaning in reality there will be about a dozen universes left, but the vast majority of them are defunct. (See below for what we mean by a "cinematic" universe.)
However, pre-Secret Wars, there were tons, getting assigned numbers for a couple of different reasons:
First of all, there are the "main" universes. These are the ones that include the bulk of Marvel's storytelling, that include multiple characters from multiple titles crossing over into each other's storylines. Of these, there are three "main" ones:
- Earth-616 - The universe in which the vast majority of the Marvel comics stories take place. Typically, unless otherwise specified, any given Marvel comic book probably takes place in this universe.
- Earth-1610 - the so-called Ultimate comics universe. An alternate universe that is a "modern reimagining" of the Marvel stories. For the most part, any Marvel comic book who's title starts with the word "Ultimate" (e.g. Ultimate Spider-Man or Ultimate Fantastic Four) takes place here. Notable for being the source of most character and story ideas in the post-2000 Marvel movies.
- Earth-199999 - The Marvel Cinematic Universe. The universe where every movie produced by Marvel Studios/ABC/Disney takes place, starting with Iron Man through (as of today) Doctor Strange. It also includes all of the ABC and Netflix television shows based on Marvel characters.
Of particular interest here is that the next Spider-Man movie will not get a new universe number, because it will be part of Earth-199999.
Stand-Alone Cinematic Universes
Other than the films produced by Marvel/ABC/Disney, all of the other Marvel-based films exist in their own isolated universes. Typically, all of the films in a given series will exist in the same universe, but each "reboot" gets a new one. Typically, any video games, novelizations, or comic book adaptations based on a movie will also exist in the same universe.
The most notable recent ones are:
- Earth-10005 - The X-Men Cinematic Universe, the universe where all of Fox's X-Men films take place, including the spin-offs like Logan and Deadpool.
- Earth-96283 - The Spider-Man Cinematic Universe, where the three Spider-Man films starring Tobey McGuire take place.
- Earth-120703 - The Amazing Spider-Man Cinematic Universe, where the two Spider-Man films starring Andrew Garfield take place.
There is also a universe for the Blade movie trilogy, one for the two previous Fantastic Four movies, one for the Daredevil and Elektra movies, etc. There are also a number of older movies, television programs, and unreleased/unaired stuff, all of which get their own universe.
Typically, when a movie series ends its run and/or gets rebooted, its universe is basically put in a state of suspended animation. It still exists, and everyone in it is considered "still around" for continuity purposes, but no further material is ever set in that universe. It is "defunct".
One-Shots and Specials
Marvel frequently releases one-shot or special event comics, that each get their own universe. Statistically, this is probably where the largest number of numbered universes come from.
For example, there's an entire series of Marvel comics called What If?, which explore possible alternate histories like, "What if Spider-Man was a member of the Fantastic Five? (Earth-772), or "What if Daredevil worked for S.H.I.E.L.D.?" (Earth-8181).
Another big contributor in this vein are the Millennial Visions series, where each story is essentially its own universe, of which I think there's almost 100.
Alternate and Aborted Timelines
Sometimes, characters from Earth-616 (or some other universe) will travel back in time and change things, creating a different world history than the original. Other times, a character might travel forward in time and see a horrible future. In both cases, by the end of the story, the heroes have somehow found a way to save everyone, fix the past, and change the future.
Many of those alternative histories have their own universe numbers, especially if they span more than one issue of a series. For example, Earth-311 is an alternate timeline where Captain America (from a completely different Earth-460) was sent to Earth-616 in the year 1602 and changed history. Thus, Earth-311 split off from Earth-616 at that point.
Visited Alternate Universes
The last group of universes are those that are merely visited and/or mentioned by characters that appear in one of the other mainstream universes. Lots of characters in Marvel (people like Doctor Strange, and the cosmic-level characters) are capable of universe-hopping, and frequently you will see characters from one universe brought (willingly or otherwise) into Earth-616. Other times, characters from Earth-616 find themselves temporarily transported into alternative universes themselves.