Sewing: The direction of the warp threads in woven fabric, parallel to the selvages. In knit fabrics, the grain direction is created by the knitting process, and is parallel to the finished edge.
Paper patterns will indicate the placement of most pieces with a double-headed arrow, which should go along the grain. The only exceptions to this rule are interfacing pieces (since interfacing is generally made using a felting process and has no grain) and pieces to go on the fold. (The fold in a bolt of fabric is always on the grain, so the fold line gives the grain direction.)
If the design on a woven fabric is suitably non-directional, pieces can also be cut with the grain line perpendicular to the selvages, lined up on the weft threads. It is the alignment with the threads that is important, not which type of thread is being aligned to.
Why is the direction of the grain important in sewing?
Generally, garments are cut "with the grain", meaning the grain is parallel or perpendicular to gravity. Garments that are cut diagonal to the grain are called bias cut.