One of the things that is confusing in the bike world is the fact that while bicycles come in different sizes, the way in which the sizes of bicycles are described is not very logical or consistent. For example, when talking about children's bikes, we tend to refer to wheel size. So we say things like "Suzy is riding a 16 inch bike now, but next year she'll move up to a 20 incher." In adult bikes, folks in bike shops refer to bikes by their frame sizes, where frame size is the traditionally refers to the length of the seat tube. In the case of the two bikes pictured above, while they both have 26" wheels, the black bike on the left has a 24" frame
While the much smaller white bike has a 13" frame.
And while a quality manufacturer and a good bike dealer will give you good guidance about sizing a bike, the big stores that try to sell everything fall back on just specifying wheel size when they sell their cheap Bike Shaped Objects. Poor fit, poor assembly, poor components and poor manufacturing all make the Bike Shaped Object something to be avoided. A good used bike is always a better deal than a new Bike Shaped Object. (My friends at Dirt Rag did a great article on BSOs a few years ago. You can read it here.)
But sizing of quality bikes is confusing. While we specify bikes based on seat tube length, wheel sizes and frame geometries factor in. Some manufacturers have longer top tubes and some kinds of bikes may have top tubes that are level while others may have sloping top tubes. Some bikes, like those designed for cyclocross, may have higher bottom brackets. Just because you ride a 52 cm bike from manufacturer A doesn't mean you'll be comfortable on a 52 cm bike from manufacturer B. And by the way, the US bike business is still schizophrenic with regards to the metric system. Road bikes usually have their frame sizes specified in centimeters, while mountain bike sizes are usually expressed in inches. And no, you can't just do a simple metric conversion to figure out your mountain bike size from your road bike size. That would be too easy. As the late, great Sheldon Brown noted, "Anarchy reigns!" But Sheldon's article here is a good guide map to some of the issues involved in sizing a bike.
With bikes, like shoes, fit is the most important thing. As a rider you are really only going to be happy if your butt, your hands and your feet wind up in the right spots. That means making sure the distance from the saddle to the bars is not too long and not too short. You want to have just the slightest bend in your knee at the bottom of the pedal stroke and have the position of the saddle relative to the cranks be such that you make the most of the power your legs can generate. (This can vary somewhat depending on the type of bike and style of riding; triathletes tend to have their saddles farther forward than folks riding beach cruisers, for example.) Peter White has an excellent fit article here.
At the top of this article I showed two 26" wheeled bikes. The larger bike would comfortably fit someone well over 6 feet tall and a five foot person would probably be comfortable on the smaller bike. Wheel size alone doesn't really tell you much about the bike, it is only one factor in the sizing.
Below I've included a picture of two of my own bikes, my Monocog Flight 29er and my Dahon D3. I'm 5'6" tall and I ride the smallest (15") frame that Redline makes for the Flight. I don't know if anybody much smaller than me could fit on a 29er but I'm perfectly comfy on my Flight. And despite a more upright position (the handlebars are closer to the seat) I also am completely comfy on my Dahon D3. The bikes feel very different but I ride them in very different environments. The 29" wheels take a bit to get rolling and then tend to roll over everything, so the Flight is a machine that just eats up the back country trails. The Dahon, on the other hand, has very little inertia in those tiny wheels, so it's quick off the line and is perfect for zipping around town. Both bikes fit me and fit into the environments where I ride them.
Size matters and so does fit. If you find a bike that is the right size for you and the right fit for you, you'll have fun riding and you'll ride more.
Keep 'em rolling,