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 line with an arrow on one end or both end* 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.
* If the line has arrows both ends, it doesn't matter in which direction you place the pattern pieces, as long as the arrow is parallel to the grainline. If the line has an arrow on one end, it means the fabric has a nap, and all patterns should be placed in the same direction.
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.