For most applications, 304 has the best combination of corrosion resistance, mechanical properties and cost.
For high corrosion resistance in food, biomedical, marine and heat exchanger applications, 316 can be worth the price difference.
The resistance to solvents, chlorides, acetic acid and especially to salt water can make 316 the preferred choice. The quality of the surface finish and the amount of cold-work (most often referred to as the hardness, as in quarter-hard or half-hard) influences the corrosion resistance greatly.