As a freelancer, I have to sign legal documents all the time. If you get into freelance writing, you'll find you're suddenly surrounded by them.
There are several kinds of legal document that regularly cross my desk:
1. Publication agreements. These are what a writer or publisher means by "contracts." A publication agreement signs over specific rights to a publisher or other organization in return for compensation (Or no compensation, but I've already stated my opinion on writers and artists working for free - always make sure you get something for it, and that that something is not "exposure").
2. Non-disclosure agreements. NDAs. If you are working on somebody else's property they will almost certainly have you sign one of these. An NDA simply means that you agree not to talk to anyone outside the company about unreleased work without their permission. NDAs can be a little bit scary, but think about it this way - what you're really agreeing is little more than "No spoilers."
3. Submission agreements. These are standard for comic book companies. If you sign a submission agreement, you are agreeing that if the company happens to do something very similar to your pitch you can't sue them. Companies are accused of stealing ideas all the time and because of that some people are reluctant to sign these. What they really do, though, is cover the company's rear - if you have more than one writer working on the same characters, it's not really a surprise if two of them come up with the same thing.
Here's a few things you should not sign:
1. A contract that grants exclusive rights in perpetuity. There should always be an exclusivity period that is laid out. The standard for short stories is six months from publication, but I have had as short as one month (Analog) to as long as several years. For novel contracts, expect several years. Never sign a life of copyright contract and avoid signing contracts that don't specify an exclusivity period at all - always ask. It could mean they don't care, it could mean they're trying to sneak life of copyright past you - or are clueless.
2. Any contract or document that refers to you as an employee. This usually happens with smaller companies and NDAs. Companies should not call contractors or freelancers employees, or they risk being liable for workmen's compensation if the DOL audits them. So, by refusing to sign the agreement unless they change "employee" to "contractor" you're helping cover their rear.
3. A contract that signs over rights the company has neither the intention nor ability to use. Some small presses try to lay claim on movie rights. Never sign these contracts. (I've stopped negotiations with a publisher over this before). Don't sign over audiobook rights unless the publisher has a solid history of using them on all, or at least most, books. If it's "If your book sells enough" then tell them you'll negotiate a new contract at that point. Note that anthology options are standard for many periodicals. A correct anthology option states that you are giving them the right to use the story on a non-exclusive basis in a future anthology for X extra compensation. Periodicals that use this option are generally those who produce annual "Best of" compilations and don't want to have to go back and re-negotiate for them.
4. A book contract that gives the publisher right of first refusal on all future works. (Series rights are a slightly different thing and may be acceptable). At the very least insist that they have a limited period, say three months, to look at the work. There are some contracts out there which basically give the publisher the power to decide what...and if...you'll write again.
5. A contract that signs over your work for no compensation unless you really are getting something worthwhile out of it. Note that if the "exposure" you would get is significant enough to be worth it then the company should be able to afford to pay you. (Charity work counts as "getting something worthwhile"). It may also be worthwhile to, for example, give away a reprint for use in a convention sampler - I've done that.