There is one type of bicycle that is extremely hard to fit-- a bicycle that is the wrong size for the athlete. I sometimes have cyclists coming from out of state for a bike fitting so I like to do my homework before they make the trip. This means ensuring they are on the correct frame size and it can be a little tricky.
Stand-over height used to be a good method of frame sizing for a traditional diamond bike frame. About 0-1 inches of clearance between the top tube and crotch (bare foot) was a decent way to determine if the bike was the correct size. With today's non-traditional frame geometries and frame types, stand-over height goes out the window. There is no frame sizing that is considered "standard" and each manufacturer may measure their frame size in a different way and from a different point. Some brands measure from the center of the bottom bracket to the top of the top tube or to the center of the top tube, while others measure to the top of the seat tube. Compact frames may use a "virtual top tube" and even this point of measurement may vary from manufacturer to manufacturer. Some frames now come in just three sizes; small, medium, and large and rely heavily on componentry to correctly fit the rider. This sizing range is great for manufacturers as they only have to produce three frame sizes, but it does leave gaps in sizing and makes getting a good fit more technical and difficult.
The net of all this is that the 51 cm bike you are riding now may be different from a 51 cm bike in another brand, and that it is important to define the sizing method used. Manufacturers generally post sizing guidelines on their websites, or at the very least geometry specifications. A good bike shop that carries multiple brands will look up the correct frame size for your inseam (sizing is based on inseam measurement) and not "eyeball" it.
To determine your inseam measurement, stand with your back against a wall (bare foot) and place the spine of a one-inch thick book against your inner leg and snug against your crotch. Make sure the book is flat against the wall forming a 90 degree angle between the wall and top of the book, then measure from the top of the book to the floor. If you used inches, convert the inches to centimeters by multiplying the measurement by 2.54. For a road bike with a conventional frame, the frame size will equal approximately 2/3 of your inseam. Now take your inseam in centimeters and multiply it by 0.67 to determine your frame size in a traditional road frame.
Women generally have shorter torsos and may need a relatively shorter top tube. This is where "woman-specific" designs come in. These bicycles may be appropriate for certain men with shorter upper bodies or riders who prefer a more upright position. Top tube length can be adjusted to an effective length using different size stems but this can affect handling. It is important to be in the correct frame for your body type and the type of riding you will be doing. Manufacturers size their frames to accommodate the normal proportions of reach to leg length. If you are outside of these proportions, finding the correct frame or bicycle to fit you will be more difficult. Take your height and divide it by your inseam. If the value of this is more than 2.2, you will need a bicycle with a longer reach or top tube. If the value is less than 2.0, you have longer legs and will need a shorter reach or top tube. Generally speaking, bicycles with a steeper seat tube angle will have a longer effective top tube length.
If you are buying a new bike, I recommend doing your own due diligence before purchasing it by checking the frame sizing on the manufacturer's website. If you are on the cusp between two sizes, ride them both to determine which one feels better after each has been adjusted correctly. Realize that the shop may not have the correct frame size for you in stock and that they are in the business of selling bicycles. A reputable shop will not sell you the wrong size bicycle, however, I have run across athletes who spent a lot of money on a bicycle that was the wrong size.
If you are purchasing a used bike, again, go to the manufacturer's website and look up your model. If it is no longer listed, you can send the manufacturer an email or take it to a coach or an experienced bike fitter to determine if it is right for you. The great deal you got on a used bike will not be such a bargain if it is uncomfortable and you can not produce power.