You would transmit "Mayday, mayday, mayday" if you are in grave and imminent danger and you need immediate assistance. You then follow up with a description of your problem. More detailed instructions on what information you would relay to ATC are found in Chapter 6, Section 3 of the Aeronautical Information Manual. Your radio transmission is given top priority over all other communications, and the frequency you are using is to maintain radio silence.
An urgency condition-for which you would broadcast "Pan-pan, pan-pan, pan-pan" to signal that you need help-concerns the safety of the aircraft or other vehicle, or of a person on board the airplane or in sight, but does not require immediate assistance. Urgency transmissions take priority over all others except distress conditions. (Aviation writer Barry Schiff says the term comes from the French word panne, meaning "breakdown.")
Note that while we tend to think of emergencies in stark terms (fuel starvation; engine failure; lightning strike), the AIM doesn't draw distinctions between what's considered urgent versus what constitutes a distress situation. In either case, it's imperative that you, the pilot in command, ask for help and let ATC know what you need in clear, unambiguous language.
For example, if you're lost on a cross-country flight, or getting worried about fuel reserves, or wondering about a rough-running engine-then call for help. If you're not sure whether you should radio "Mayday" or "Pan-pan," FAA publications suggest that you go for the maximum amount of help available. The key here is not to let an urgent condition evolve into a distress situation because you waited too long to notify ATC.
Learn more about how ATC can assist you in normal and emergency situations by attending the AOPA Air Safety Foundation's free seminar, "Say Intentions: When You Need ATC's Help." For a schedule, see AOPA Online.