The first number (39) is the number of teeth in the smallest chainring (the smaller the number the lower the gear). The 2nd number is the number of teeth in the largest freewheel cog (the larger the number the lower the gear). Typical double cranksets come with 39-42 teeth in the smaller chainring and 50-54 teeth in the larger one. Triple cranksets would have an additional granny ring of 30-36. Cassettes can come with a smallest cog of 11, 12, or 13, and the largest cog can vary widely, from 20 to 27 or even 32. The gears you need depend on the bike, your fitness, and the terrain. To compare gear ratios, calculate this number:

(#teeth in chainring)/(#teeth in rear cog)*(diameter of wheel)

If wheel diameter is in inches, you'll get numbers from ~30 to ~110. That number, after you multiply by pi, give the number of inches the bike will travel per revolution of the cranks. This lets you compare gear ratios from different bikes with different wheel sizes and different cranksets and clusters.