(This question is meant to be a resource to direct others to given that this is a common question.)
Given the task of creating an image that will be printed at a certain dimension, what pixel dimension and resolution should I be setting my file at?
The only definitive answer to this question is: Ask your vendor.
Every vendor, every printer, every t-shirt maker, etc will have their own particular preferences as to how they want to receive files and how they want them set up. Discussing this with your vendor before you begin is crucial to ensure that the process goes smoothly.
The general rules of thumb, however:
Offset printing of brochures, business cards, menus, postcards, etc.: 300ppi
Generally, for printing materials that you'd tend to consume at an arm's length (brochures, flyers, business cads, etc) you are going to want to set up your file at 300ppi. This will provide enough image data to produce an image of decent quality. If necessary, you can usually drop to 240ppi and still be safe.
Exceptions to the rule:
Screen Printing: no higher than 300ppi
Screen printing quality is heavily dependent on the substrate that it is being printed on, the mesh count, and the ink used. Fine art prints on archival paper can get away with resolutions close to 300ppi. That Hanes t-shirt can likely handle no more than 75ppi.
Inkjet/Giclee: Minimum of 300ppi
Inkjets have gotten amazingly good and a lot of art is now printed directly to Inkjet. The fancy term for this is "Giclee". Today's printers can handle at least 300ppi and many can go much higher--especially those that use 6 color printing.
Large format printing (any method): typically <72ppi - 150ppi
This category can range wildly from advertising posters, vehicle wraps, 2 story billboards, etc. The variable to consider is the distance the viewer will be from the material. A person driving on a highway will never be able to discern the difference between 300dpi on a billboard and 40dpi. You would up close, of course, but the only people viewing a billboard up close are those installing it. Most advertising posters can get away with 100ppi. Vehicle wraps, much less.
Exceptions to the rule:
Generic Exceptions to the above rules
Pixel dimensions vs. print resolution
One area that can add confusion is that the ppi setting you see in the PhotoShop file is typically only applicable to PhotoShop--and perhaps other Adobe software. For the most part, most software only cares that you have enough pixels in the image to print it at the size you want to print it at. So, for example, the following two image files are exactly the same image:
Image 1: 72ppi, 720px wide
Image 2: 300ppi, 720px wide
On the computer, those two images are identical because they contain the same amount of pixels. If they were both imported into a program like InDesign or MS Word and sized to look the same size on the page and printed, they'd be exactly the same.
On the other hand, if you were to print directly from PhotoShop (which it should be noted, is rare for printers) you will get two different results. The first will end up being printed 10" wide, and look fuzzy as it's only 72ppi. The second one will be printed at roughly 2.3" wide, and look great, albeit small, as it is set to 300ppi. Same amount of information in each file, but one had much larger pixels when printed.
This is mentioned because some print vendors may work with low PPI settings but large pixel dimensions. Some software may also completely ignore the PPI meta data and only care about the pixel dimensions.
Images for the web
As a footnote, images that are to be displayed on the web disregard ppi settings completely. All that matters is the pixel dimensions. If your image is 600 pixels wide, it will show as 600 pixels wide regardless of the screen and the size of pixels on said screen. 72ppi is the 'default' setting for web images, but it's just tradition, rather than any sort of technical requirement.
(Everyone: Please edit/add to this as you see fit!)