I have a formula for the length of your loop based on the tempo and number of measures, where L = the length of the loop in seconds, B = BPM, T = the number of beats per measure (the top number in your time signature) and M = the number of measures your loop spans.
L = M×(60/(B/T)
If you don't understand algebra well enough, I'll explain. Divide your BPM by the number of beats per measure (if you're using 4/4, then it's obviously divide by 4; if it's 3/4, divide by 3). Then do 60 divided by that result. Then multiply by the number of measures. You'll probably end up with a weird decimal number most of the time, so use that zoom feature and use the nearest sample (those little dots you see when you zoom in very close; those are called samples). Once you're done highlighting, use Export Selected Audio and you're good to go!
Example: my song is 120 bpm with a 4/4 time signature. I have 32 measures in my loop. 120 divided by 4 is 30. 60 divided by 30 is 2. 2 times 32 is 64. My loop is 64 seconds (1 minute, 4 seconds) long. In my DAW, I make my loop run 3 times back to back. After mixing it down to a wav file, I would import that file into Audacity and highlight (to the sample) from 1:04 to 2:08 (minus one sample at the end). I use Export Selected Audio in the file menu, and export a perfectly looping mp3 file. Bam.
If you'd like to see a demonstration of this, I made a video doing it myself.
JK-FlipFlop
@Phronemophobia
https://soundcloud.com/jk_flipflop/gas-mans-stage-sega-genesis
Did I fuck up?