I've heard from various sources that you must always sand in the direction of the grain. Is this always true? Does it depends on the sanding paper's grit, tool used or the wood being sanded? What are the advantages of sanding along the grain?
In general yes, you will have a much nicer finish much faster by sanding with the grain.
The larger the grit (60 vs. 100) will leave larger 'gouges' in the wood when sanding. The grit is an 'average' size of the grains and the larger ones can leave deeper marks. Sanding with the grain the marks are much less likely to cut across the wood grain, leaving an obvious trail.
So by sanding along the grain you will need less time with finer and finer sandpaper to get the same finish. While you can do the same thing by sanding across the grain it will take much longer.
An easy example is to take a board that is pretty smooth and in one area sand across the grain, then take a much finer sand paper and sanding with the grain sand the whole board. It becomes pretty obvious quickly the 'damage' done.
Random orbit sanders do a decent job of minimizing the worst of the cross-grain cutting. I've also found that the orbit sanding disks have a smaller variance in their grit.
Sanding across the grain sometimes cuts faster, but sanding with the grain lines the scratches up with the grain so they blend in better.
Assuming you're going through the usual sequences of increasingly finer grits, it's really most important that the final pass (meaning the finest grit) be with the grain.
In fact, one common suggestion for users of random-orbital sanders is to do a final light pass by hand with the grain to clean up any remaining cross-grain scratches.