Is there much of a pattern involved going lengthwise? If you have repeats going, you'll have to figure out whether you can deal with either stopping a repeat short or a repeat long of the length you want. Otherwise, as Sophie says, just stop when it's the right length. If it gives it by row instead of by length, just do the math -- multiply and/or divide by the gauge, so if it's 20 rows to 4", and the pattern calls for 100 rows, you know the length is supposed to be 20" long. I think.
Anyway, it's just a pattern, so figure out how long you want it to be and knit it to that! I love customizing patterns so they work for me, not for someone else!