How does a pilot file a PIREP?
I'll tackle the "How" first - you call up Flight Service (either on the radio or on the phone after you land) and tell them you have a pilot report.  There's a standard format for pilot reports, and if you give all the information in the order it appears on that form it's faster for you and the person taking the report.
If you're filing a pilot report on the ground for conditions you encountered enroute you need to specify the (Zulu) time of your observation (or tell the briefer "20 minutes ago"). In the air it's generally assumed your report is for "now".



Pilots are requested to provide pilot reports for significant deviations from the forecast weather, or for hazardous conditions. Basically we provide them as a courtesy and service to our fellow pilots (like flashing your lights at other cars on the highway if you know there's a speed trap).

Some pilot reports you may want to file in flight are if the Winds Aloft differ from the forecast. If the forecast told you you should have a 10 knot tailwind and you actually have a 5 knot headwind that's pretty significant, and if you tell Flight Service they will pass it along to the weather forecasters and they'll factor it in to their next Winds Aloft calculation. It will also appear in the next pilot's briefing so they'll know the winds in the forecast aren't correct.
Another example is turbulence: If you're encountering continuous moderate chop at 7,000 feet but smooth air at 9,000 feet providing that information could be useful to the next pilot flying through the same area.

A classic example of a PIREP you file after you're on the ground is icing: If there was no icing in the forecast but you've encountered some you should report these conditions. If you're under ATC control you'll obviously tell them, but when you're on the ground you should call Flight Service and file a formal pilot report. Again, the information will be passed to the weather forecasters and the icing AIRMET will be updated, and your PIREP will be passed along to other folks in their briefings to keep them out of the ice.