Salting your steak long before grilling, ideally at least 40 minutes and up to a few hours, is generally better than salting right before. This allows the salt to penetrate the meat, drawing out moisture which then dissolves the salt and is reabsorbed, resulting in a more flavorful and tender steak.
When you salt a steak, the salt initially draws moisture to the surface. If you grill immediately after salting, this moisture will evaporate, leading to a drier steak and hindering a good sear. However, if you wait long enough (around 40 minutes or more), the salt will dissolve in the drawn-out moisture, creating a brine. This brine is then reabsorbed into the meat through osmosis. This process, known as dry brining, seasons the steak from the inside out, tenderizes the muscle fibers, and ultimately results in a more flavorful and juicy steak. If you don't have 40 minutes, salting right before grilling is better than salting in between, as it will still contribute to surface flavor.
Use kosher salt or sea salt for salting your steak. Avoid iodized table salt, as the iodine can impart a metallic taste. Also, don't be shy with the salt! You need enough to properly season the entire steak.