That depends. Is this for mash pH, or just flavor? Adding salts to the grains/mash water will influence mash chemistry. All three will drive the mash pH down a bit, which usually is a good thing unless brewing a very dark beer with low alkalinity water. When I'm adding salts, I usually add them to both my mash water and sparge water BEFORE adding them to the grains, the exceptions being acid or baking soda (if either are needed, the acid usually is needed, baking soda rarely needed) to adjust the pH up or down after measuring it.
Now, if you aren't trying to adjust the mash chemistry, and are just adjusting the mineral profile in the finished beer for flavor purposes, then don't add to the grains, add directly to the boil kettle.