That's a tough question to answer, but here's what I've learned.
As soon as I had built up a decent stable of clients and was writing full-time (and occasionally overtime), the answer had to be no. My time is valuable, and I won't give it away unless it's for someone I really love or a cause that's close enough to my heart to be worth it. If you have a friend who fixes computers, ask him or her what happens when you fix a friend or relative's computer for free. They understand.
When I was just starting out, the answer was hazier. I did some work for a start-up newspaper for free because I knew an editorship was going to be offered to me and I had enough other income that I wasn't dependent on writing yet.
The key is to make sure it's absolutely clear to both you and the person asking the favor that it's a one-off gig, and that you will get something out of it, whether it's a byline, or the ability for you to link to the page you wrote so future clients can evaluate your style and skills. Even if you don't write up a formal, signed contract, make a list of exactly what you'll do and give your friend a copy.
If you're not clear about the "terms" for free work, the strain on your relationship (even if it's a mostly professional relationship) can be too much. I have known too many writers and artists who do work for friends for free, are never acknowledged, and are asked for revisions or extra work that clients normally have to pay dearly for.
Remember: your time as a self-employed person is every bit as valuable as the time of the person who goes to an office every day. You should value that time, and when people want to use it without paying you, you should make certain you get something out of it as well.
Photo Credit: Ambro / freedigitalphotos.net