It’s common to be instructed to apply a finish in the direction of the grain, called “with the grain.” Doing this is usually best when brushing a finish, but it’s rarely necessary when wiping or spraying a finish.
Brushing with the grain is best because the grain will help disguise the brush marks, the ridges and troughs caused by the movement of the bristles along or across the surface. If you brush across the grain, the brush marks will stand out in contrast to the grain of the wood.
There are exceptions, however. These include solid or veneer with their grain running in different directions – for example, breadboard, sunburst, parquetry, etc. If the grain of the boards or veneer runs in the same direction, it’s always best to brush with the grain.
Spraying, and wiping on and wiping off, are different. With spraying, as long as you build the finish enough so there aren’t dry streaks or areas with too little finish, it doesn’t make any difference in which direction you spray. For example, you might find it easier to spray horizontally on installed vertical panels rather than turn the air nozzle 90 degrees and spraying up and down.
With wiping, as long as you wipe off all the excess, it doesn’t matter in which direction you wipe on the stain or finish. The only consideration is in wiping off. If there is any chance that you may leave streaks, because you don’t get all the excess wiped off, you should wipe off with the grain.