“Salt the water until it tastes like the sea.” It is the most repeated piece of pasta advice in the English language, and it is wrong. Real seawater is around 35 grams of salt per litre. Salt your pasta water that hard and the result is inedible, plus you will have wasted most of a box of salt to do it. The advice survives because it sounds romantic, not because anyone who says it has measured.
Here is what actually matters, and how much salt to use without owning a scale.
How salty, really
Aim for somewhere between 7 and 10 grams of salt per litre of water. For a normal pot, four litres of water to cook 500 grams of pasta, that is roughly two rounded tablespoons of table salt, or a bit more if you are using coarse sea salt or kosher salt, because the flakes are bulkier and a tablespoon holds less actual salt.
If you want a taste test instead of a measurement: the water should taste pleasantly seasoned, like a soup you would happily eat. Not a mouthful of brine. If it makes you wince, you have gone too far.

Why you bother at all
Salting the water is the only chance you get to season the pasta itself. The noodle absorbs water as it cooks, and it absorbs whatever is dissolved in that water along with it. Salt at this stage seasons the pasta from the inside out. Skip it, and no amount of salty sauce on top will fix the bland centre. You will taste the difference as a kind of flatness you cannot quite place.
This is the part people underrate. A well-salted pot of water is doing more for the final dish than most of the fussing that happens later.
When to add it
After the water boils, before the pasta goes in. The old worry that salt added to cold water will pit or damage your pot is real for cheap thin-bottomed pans left to sit, but for the minute it takes a full pot to come to the boil it makes no practical difference. Add it whenever you remember, as long as it has dissolved before the pasta does.

And ignore the claim that salt makes the water boil faster or hotter. The amount you would need to raise the boiling point in any meaningful way would make the water undrinkable. The effect exists in a physics textbook. It does not exist in your kitchen.
The pasta water is a tool, not waste
Before you drain, save a mugful of the cooking water. It is salted and full of starch the pasta has shed, and a splash of it loosens a sauce and helps it cling to the noodles instead of sliding off into a puddle at the bottom of the bowl. This is the single cheapest upgrade to a weeknight pasta, and it costs nothing because you were about to pour it down the sink.
What you should not do is salt the water to compensate for an under-seasoned sauce. Season the sauce on its own terms. The water seasons the pasta. They are two jobs. The same logic applies to fat: a plain bowl of well-salted pasta finished off the heat with a good extra virgin olive oil and a little of that starchy water is a real dinner, no sauce required.

The one exception worth knowing
If you are cooking pasta that will finish in the sauce, risotto-style, the way a lot of restaurant kitchens do it, you salt the water a touch lighter. The pasta keeps absorbing seasoned liquid in the pan, the sauce reduces and concentrates, and a heavily salted start can tip the whole thing over by the time it lands in the bowl. For everyday boil-and-drain pasta, this does not apply. Season the water properly and move on.
What we do
A big pot, filled most of the way. Two rounded tablespoons of fine salt once it boils. A taste of the water with a spoon before the pasta goes in, adjusted if it is flat. A mug of the water set aside before draining. That is the whole method, and it is more reliable than any sentence with the word “sea” in it.