Most patterns will specify a target Gauge that must be met in order to ensure proper sizing. This is doubly true of larger pieces, where a variation in gauge can multiply across the piece. Thus, a vital first step when beginning a project is the creation of a gauge swatch, a small piece of knitting created in order to determine the gauge generated by a given combination of yarn weight and Needle size.
Most patterns start off by specifying a needle size, a number of stitches to Cast on, and a swatch pattern to follow along with the number of rows to work (if no pattern is specified, you can assume Stockinette stitch), and the target swatch size. Proceed to construct the gauge swatch by casting on the requisite number of stitches and knitting the necessary number of rows in pattern. Once complete, measure the swatch on the wrong side and see if the target size has been reached. If the swatch is too small, try again with a larger sized needle, and if the swatch is too large, move to smaller needles.
Now, generally speaking, row gauge is less important then stitch gauge, as most patterns are knitted to a specific size. However, there are some designs that require very specific row gauge, such as Raglan patterns, or designs where the length is determined by repeats of some intricate pattern. In these cases, if you're able to achieve the correct stitch gauge, but your row gauge is off, you can adjust by switching to a different sized needle every other row.
Specifically, if you have too many rows per inch, switch to a larger needle on the purl rows, and if you have too few, switch to a smaller needle. This may require some experimentation to reach the correct row and stitch gauge.
In any case, a Gauge ruler is an invaluable tool, particularly for patterns that require a very specific gauge. With it, one can regularly check to ensure that the gauge is correct and consiste.