Any time you wash a sleeping bag, you subject it to wear and tear and decrease the loft a little. Spot cleaning the shell with a paste of laundry detergent, water and a toothbrush is advised before washing the whole thing. This is especially true around the hood and collar where hair and skin oils tend to accumulate. By holding the shell or liner fabric away from the insulation, you can wash and rinse the area without getting the inside wet. However, if you find that your bag is losing loft, is darkened with grime and basically no longer inhabitable unless you wash it, then by all means do so! At this point, washing will actually help restore the loft, and your tent mates and innocent forest creatures will probably thank you for it, too.
Note: Dry cleaning is not appropriate for sleeping bags, especially down. Solvents used in dry cleaning can strip the natural oils from down that help it retain loft. Solvents are also very difficult to remove from synthetic insulation. If you decide to wash your bag yourself, use a gentle, non-detergent soap, which is made for washing down - and synthetic-filled items. Down: For down bags, hand-washing in a bathtub works best. Fill the tub with warm water and wash with a glycerine soap. Put the bag in and gently work in the soap and allow it to soak for 15 minutes. Drain the tub and press out any remaining water. In a cold-water rinse, work the soap out gently, let the bag sit for 15 minutes and drain. Press out any remaining water. Repeat the rinse until all the soap is out. It's also possible, (according to some bag manufacturers) to machine wash a down bag, as long as a front-loading washer is used. Never use an agitator-style machine as the motion can damage the stitching and insulation. Make sure to wash on the gentle cycle in cool water with one of the aforementioned down soaps. Synthetics: Synthetic bags can be washed in the same way. Hand-wash in a bathtub, or use a large, front-loading washer with no agitator. Use cool water and mild soap. Rinse several times to make sure all the soap is removed. An extra spin cycle or an extractor may be used to remove excess water.
Air drying is the safest way to dry your bag, but obviously the longest. If you tumble dry your bag, use very low heat or a no-heat setting and keep an eye on it. Dryers have varying heat outputs, so you need to check periodically to make sure the shell and insulation aren't overheating, which can actually lead to melting. Add a couple of clean tennis balls when the bag is nearly dry. This will help break up any clumps of insulation and help restore the loft.
How you store your bag between trips affects its lifespan. When you arrive home from a trip, first air out the bag inside-out for a couple days to make sure it's dry. Then store in a large cotton storage sack—often included when you purchase a sleeping bag, but also available separately. Do NOT store your bag compressed in its stuff sack as this will eventually suck the life out of the loft. Watertight storage bags are also a bad idea. Condensation can build up inside.