There's a short answer and a longer, more complicated answer; I'll just give the short answer here along with the barest basics of the long answer.
The short answer is: Yes, there is, sorta. If you take the ratio of the frequencies of the two pitches, you'll get some fraction in lowest terms. The smaller the numbers in that fraction, the more consonant the interval. For example, two pitches in unison have a 1:1 ratio. An octave has a 2:1 ratio. A perfect fifth (such as C to G) has a 3:2 ratio, etc. Matthew does a good job in his answer explaining why ratios with smaller numbers sound more consonant than ratios with larger numbers.
But this is all made more complicated by temperament, which is the way in which pitches are tuned relative to each other. See, suppose you tune your A to 440 Hz and then start tuning the other notes relative to that A, using the whole-number ratios as a guide. You'll tune E at 660 Hz, for example. For the first few notes, everything will sound great, but it won't be too long before you start to hear some strange intervals. Some intervals have nice, whole-number ratios, but then others that you'd think should sound good, like the major third from Eb to G, sound really bad. To make a long story short, it turns out to be impossible to tune all twelve chromatic notes using whole-number ratios of frequencies and have everything come out right. Mathematically, it just can't be done.
So you have to make some compromises somewhere. There are many, many different ways to make such a compromise, and I won't detail them here. But for the last two hundred fifty years or so, we've settled on a tuning system known as Equal Temperament. In this system, you start with a reference pitch (e.g. A440), and then the frequency of every other note is 2n/12, where n is the number of half-steps above the reference pitch.
In this system, none of the intervals will have whole-number ratios. But all intervals are consistent (some would say consistently imperfect), and so it allows you to play in any key. It's an effective compromise, but you lose the purity of true whole-number ratio intervals. And so the short answer I gave above turns out to be only sort-of correct, because the consonant intervals will have ratios that are almost, but not in fact actually, nice small whole-number ratios.