We just cannot emphasize enough how important it is to make sure you're riding on a bicycle that is the right size for you. First of all, it just won't feel as comfortable and secondly, riding on a smaller or a larger frame can seriously mess you up in the long run.
There are 3 things you need to look out for when choosing the right size of bicycle:
Frame Size
Stand Over Height
Top Tube length
The Frame size is normally measured along the length of the Seat Tube, but all the way up to the top of the Seat Tube, just where the seat post starts (see Ì¢åÛå÷A' in the figure). This measurement is either in inches or centimeters based on the manufacturer or the type of bicycle (road, mountain, hybrid, etc.)
The Stand over height is denoted by the letter K in the figure (Distance from the ground to the top tube). When standing over the bicycle, you need to ensure that you have at least an inch or two of clearance between your crotch and the top of the Top Tube
The Top tube length (indicated by C in the diagram) signifies how much you will have to lean forward or sit back when in your riding posture. However, sometimes depending on the handlebars and stem length, your comfort level can vary and therefore must also be considered.
That said there is no perfect way to pick the perfect bicycle for you based purely on measurements. Sometimes you just have to try a bicycle to see if it's working for you.