The price difference is about 30–40%, but the cost of choosing wrong far exceeds the price gap. Judgment lines are given based on three dimensions: medium, chloride concentration, and temperature.
Short answer: use 304 for indoor, low-chloride and decorative parts; switch to 316L when chlorides are present, when service is continuously above about 60 °C in a chloride-bearing medium, or for welded marine and chemical equipment. 316L contains 2–3% molybdenum, which resists pitting and costs roughly 30–40% more than 304.