Citizens of the USA, Canada, Australia, New Zealand, South Africa, Switzerland, Norway, Japan, Taiwan, Brazil, Argentina, Mexico, other Central American countries, Israel, UK and other EU member countries do not need an advance visa, but must purchase a single-entry tourist card for US$10 when entering the country. It is typically good for 30 days, but you can request up to 90 days - be sure to ask when you step up to the immigration counter. You are technically required to have a return or onward ticket, but this is rarely checked. Note that the new Salvadoran tourist card is a large sticker which takes up a full page of your passport - be sure you have plenty of free space! For those who do need visas, the cost is US$30.
If you leave El Salvador by land and return within your original allotted time, you are not supposed to have pay the US$10 again. Officials at some border crossings may still try to charge you - throwing a fit probably won't help, but respectfully explaining what you were told when you got your tourist card and asking the officer to double check the rule shouldn't hurt. The provision is relatively new (and very few tourists make use of it) so in many cases officers are simply unaware of the rule.
If you lose your visa or tourist card, or want to extend your stay, go to the Salvadoran immigration office (Direccíon General de Migración y Extranjería; 2202 9650; Galerías Escalón, street level, Paseo General Escalón; 9am-5pm Mon-Fri, 9am-1pm Sat).