This
CHAIN SIZING VIDEO should help if you have your new gear setup installed. You can use a small rope in place of the chain to get the approx chain length you need if you don't have a chain yet. In current terminology a link is 0.5" so multiply the rope length in inches by 2 to get links. This technique works for short and most medium cage derailleurs. For long cage derailleurs, add 2 links. Hint, never round down in measuring your chain length, always round up to the nearest even measurement, i.e. a measurement of 61.3 inches would indicate a chain length of 122.6 links, round up to 123 links, make it even at 124 links. Order a 126 link chain and take a couple of links off.
You can also the formula published by
PARK TOOL or this
CALCULATOR that produces similar results. You will need to measure your chain stay length to use either of these calculators.
From Park Tool:
Simple Equation: L = 2 (C) + (F/4 + R/4 + 1)
L = Chain length in inches. Round the final result to closest whole inch figure. C = Chain stay length in inches, measure to closest 1/8″. F= Number of teeth on largest front chainring. R= Number of teeth on largest rear cog.