Woven fabric consists of threads that are woven at 90 degrees to each other. The line of the thread is called a "grain". The grain that runs the lengthwise of the fabric is called the warp (or just "lengthwise") grain, and the horizontal threads of the fabric is called the weft (or "crosswise") grain.
For example, if you pull woven fabric through the crosswise grain, it will usually have a little move give or stretch than it does across the lengthwise grain. If you pull the fabric at 45 degrees to both of these grains - the bias grain - it will stretch a bit more again.
The direction of the grainline matters because the direction a pattern piece is placed and cut on that grain affects the hang of the garment. Each pattern piece will have a double headed arrow printed on it - the arrow should be placed parallel to the lengthwise (warp) grain. This lengthwise grain is also known as the "Straight Grain", because it is the strongest grain and least likely to stretch.
A piece of fabric marked with the lengthwise, crosswise and bias grains.
The arrow on the pattern pieces should be placed parallel to the lengthwise grain.