Let me try to unpack this a bit. Aaron's excellent answer addresses the mechanics of what is a mikvah; I'll walk through when one needs to use one.
There are plenty of times the Torah talks explicitly about a requirement for someone to immerse in water; have a look at Lev. Chapter 15 for example. Our tradition has it that this means a mikvah. In fact the term mikvah is spelled out explicitly as such in Lev. 11:36.
So a Mikvah for Niddah is a Torah law. That's why a Jewish community needs a Mikvah immediately -- without one, married couples can't be together. This is the #1 reason for a mikvah. (In the 1940s there was a Senator Taft from Ohio who received a document from a Jewish community listing many reasons why a mikvah is so important; he looked it over and immediately realized -- correctly -- that the paramount one is so there can be family life.)
Mikvah for conversion is also a Torah law. (This one is derived from the Sinai experience, effectively a mass conversion, where it says they had to wash themselves.) But unlike Niddah, there's not the same burning need for every community to be able to do conversions any day of the year.
Beyond that -- in Temple times, people had to be ritually pure if they wanted to enter the Temple or eat a sacrifice in Jerusalem, so if you wanted to do that (and you needed to for Passover), you'd have to find a mikvah.
Today, many men have the very nice practice of dipping in a mikvah on a daily, weekly, or pre-holiday basis; this is certainly not of Biblical force and is ... well a custom with some rabbinic-law underpinnings, let's put it that way. (To oversimplify: At one point there was a rabbinic policy that the same way men had to immerse in a mikvah to eat sacrifices, they should immerse to study Torah every day.)
It is really, really important not to confuse the vital needs of the mikvah with the nice-to-haves. Rabbis Samson Raphael Hirsch and Moshe Feinstein both wrote that if men using the mikvah causes it to be less clean, which results in one married woman not using it -- or even makes it difficult for the women -- then get your priorities straight -- throw the men out of there! It would then be meritorious -- but not obligatory -- for the community to build a separate men's mikvah.