(CareerBuilder.com) -- Many studies over the past few years have shown that workplace friendships increase productivity, team morale and workers' overall job satisfaction; and since friends provide us with support, comic relief and a sense of belonging, it seems only natural that having friends at the office makes work more pleasant.
Yet despite the many benefits, experts advise that workplace friendships should be handled with care, given that they combine workers' personal and professional lives.
"Workplace friendships can be a double-edged sword," says Irene Levine, a professor of psychiatry at New York University School of Medicine and author of TheFriendshipBlog.com.
"Whether they are good or bad depends on the individuals and their roles. While relationships with colleagues can enhance creativity and job satisfaction, they should be approached with some caution. Some friendships fall apart and can make it very difficult to face your ex-friend each time you pass in the hall."
Who you associate yourself with in the workplace will also affect how your superiors and co-workers perceive you, says Helen Cooke, owner of Cooke Consulting, a human resources and organizational development firm.
"We're all judged by the company we keep for better or worse," Cooke says.
Yet despite any potential pitfalls, it is possible to reap the benefits of having friends at work without wreaking havoc on your career. Here's how to set boundaries for your workplace friendships:
Keep your guard up, at least in the beginning
Though you may form an instant bond with a co-worker, resist the urge to share too much personal information right off the bat.
"Approach a new friendship on the job slowly, being cautious to not get too involved too soon," Levine says. "You want to give yourself sufficient time to build trust and really get to know your co-worker before you spill intimate details of your life. So, for example, you might want to start out sharing coffee breaks or lunches before you spend a long weekend prowling bars together. Or you may want to talk about sports and politics before you talk about your personal life."
Levine also cautions workers who are new to a job: "This is a time when you need to keep up your guard up a little bit, because you may be getting too cozy with the office buffoon," she says. "While you should be friendly, keep your relationships on a superficial level until you get to know the workplace and the cast of characters."
Keep the in-office socializing to a minimum
It's fine for the two of you to take lunch breaks together, sit together in a meeting, or go for mid-afternoon coffee once in a while, but don't spend an hour a day sitting on each other's desks and rehashing the weekend gossip.
"If friends get too involved in workplace dramas -- for example, an office crush, a mean boss, ganging up on a co-worker -- this can undermine productivity," says Susan Shapiro Barash, author of "Toxic Friends: The Antidote for Women Stuck in Complicated Friendships."
Indeed, says career and etiquette expert Sandra Lamb.
"Office friendships are a balancing act. To properly maintain them, it's best to keep them fairly low-profile, and agree with your work friend to do most of your get-togethers outside the work environment," she says. "That prevents the accusation that you're involved in too much socializing at work -- a reflection on your productivity. My advice is to keep [the friendship] primarily out of the office."
Be careful with reporting relationships
If you count your boss as one of your best friends, take note: "When there's a reporting relationship between two individuals, it's particularly important to build in agreed-upon boundaries so that others don't feel there's any unfairness or preferential treatment," says Helen Cooke, owner of Cooke Consulting, a human resources and organizational development firm.
Even if your boss was the best man at your wedding, try not to flaunt your close relationship in the office. When it comes time for recognition or a promotion of your own, you don't want your co-workers thinking it was all due to your friendship with the higher-ups.
Additionally, says Cooke, if you and a work friend started out as peers and one of you gets promoted, new boundaries must be set that reflect the reporting relationship.
"For example," she says "You and I were peers on a team of five and known to be 'tight.' Now you've been promoted. While you can still be yourself with me and we can talk about our hobbies and weekends, you need to not complain to me about another member of the team -- even if that IS how you would have behaved in the past. While we're all entitled to having a trusted colleague with whom we can vent, if that trusted colleague is one of your direct reports that is unfair and dysfunctional."
The bottom line, Levine says, is to "never forget that you're primary focus has to be on your work, which means you may need to set boundaries with your co-workers about how much time you can spend schmoozing.
"Just as importantly," she says, "You need to respect the boundaries drawn by your co-workers, even if they aren't explicit. For example, if you see someone turning to their computer or looking at her watch while you are talking about your date last night, they may be signaling that they really want to get back to work and you've outworn your welcome."
© CareerBuilder.com 2011. All rights reserved. The information contained in this article may not be published, broadcast or otherwise distributed without the prior written authority.