The important one here is restaurants. Theoretically, tipping waiters is optional, but in practice you should always leave a tip. In many areas of the U.S. it is legal to pay waitstaff less than the mandatory minimum wage, so tips often form the majority of their income, and the tips are often shared with the rest of the service staff as well. If you receive exceptionally poor service that is not corrected when you complain, a deliberately small tip (one or two coins) will express your displeasure more clearly than leaving no tip at all. Tips are normally left as cash at the table when you leave (there is no need to hand it over personally or wait until the tip is collected), but if paying by credit card you can also add it directly to the charge slip when you sign it. For larger parties (sometimes over 6, almost always over 10) it is common for "gratuity" of 18% or so to be added to the bill and included in the total. In this case, an extra tip is not necessary. This will be stated somewhere on the menu, and you should also review the bill carefully before paying to be sure gratuity was not mistakenly added or omitted.
Tipping is not expected at restaurants (including fast-food chains and cafeterias) where patrons stand at a counter to place their order and receive their food. Some such restaurants may have a "tip jar" by the cash register, which may be used at the customer's discretion in appreciation of good service.