You'll see many different ways of measuring a bike on the internet (and even between bike shops in some cases), and each has its own merits, but the easiest (and most accurate) way to choose the right size frame for you, short of paying hundreds of pounds for a professional fit, is below. Simply fill in the required measurements, and the appropriate sizes will be calculated for you.
Many manufacturers now sell their bikes as small, medium, large and extra large (S, M, L and XL), and give a suggested rider height for each. While this is a useful general guide, it doesn't take into account varying proportions. Most size stickers will give seat tube and top tube dimensions, which you can compare with the below: