It depends on the particular target you are going for.
For a Heavy, often times you need to charge up, even if you are going for a head-shot.
If, however, you are going for a faster enemy (e.g. a scout or medic), your best bet is to go for one uncharged headshot, or two quick body shots.
And finally, charging up when you don't have an enemy in sight is usually a good strategy, because you can usually one-shot any non-uber'd enemy with a full-charged head-shot.
gaming.stackexchange.com/users/91/John Gietzen
This info from the TF2 Wiki seems pretty relevant to your question.
The only classes that you can't kill with a zero charged headshot with the sniper rife are Solider, Pyro, Demoman and Heavy, with each of these requiring 17%, 9%, 9%, and 50% charge for a one shot (headshot) kill.
Also worth noting that you can oneshot kill (bodyshot) a Scout, Engineer, Medic, Sniper and Spy with a 100% charge if you think it's a better bet than the head.
All of this goes out the window if a medic is charging, but the above link has info on that too.
gaming.stackexchange.com/users/719/Jon McAuliffe
Personally I no-scope when they are really close or it's a scout.
Otherwise I try to scope them with a headshot.
I'd say I get fairly decent results, but not great.
I'd love to see some other sniper responses here, as I'm not totally confident that's the best method.
gaming.stackexchange.com/users/35/Jon Mabe
It is for this reason that I personally prefer to use the Huntsman.
It has a faster charge up, but smaller zoom.
gaming.stackexchange.com/users/306/Albort
I would say do a quick scope uncharged headshot if the scout is going to get close to you, I would go for that than regular body shot.
gaming.stackexchange.com/users/34181/Set
An acceptable strategy: Don't scope until you see a target.
If it's a Heavy, scope and fully charge a shot (being careful not to let him see you or your dot).
They're not likely to reach you in the time it takes to fully charge.
If it's a Soldier, Demoman or Pyro, charge about halfway before taking the shot.
If it's anything else, an unscoped headshot will do.
Don't even bother with a Scout unless you're very sure of your aim.
If you're not sure, charge up and go for a bodyshot.
This keeps you out of scope most of the time, allowing you better situational awareness and target-picking.
This also depends on what KIND of sniper rifle/bow you have, whether or not they know you're sniping, whether or not they're being overhealed/ubered, the skill of the player you're sniping at, and whether or not the Soldier/Demomen know how to rocket/grenade jump.
If you're using a bow, you don't need to worry as much about when to charge.
The bow charges pretty quickly, and is better suited for mid-range fire anyway.
If the target knows there are snipers, be prepared to take a less-than-ideal shot as they weave and dodge your fire.
Any damage is better than no damage.
If they know where YOU are specifically, move somewhere else.
There's a high chance they will focus you down and make your sniping position undesireable.
If they're overhealed, be prepared to charge a bigger shot for them.
If they are ACTIVELY being overhealed, try to aim for the Medic first.
Even if you don't kill him, making him flee for health is a victory in itself, and will make future targets softer.
If there is an uber, don't waste a bullet.
If they know how to rocket jump/grenade jump, aim for the spot where they intend to land, or at the peak of their jump, where their horizontal mobility is at its lowest.
Be prepared to no-charge this shot, or charge it just long enough for them to reach their peak/bottom.
If you're lucky, they'll kill themselves with their own jump.
gaming.stackexchange.com/users/55285/Zibbobz
Is it prudent to fully charge my sniper rifle in most cases?  If an enemy gets up close, am I better off trying to scope-n-shoot, no-scope, or try some other weapon?
Should I fully charge my sniper shot?
gaming.stackexchange.com
<team-fortress-2><tf2-sniper>
gaming.stackexchange.com/questions/166
gaming.stackexchange.com/users/11/Jeffrey
Do a quick uncharged headshot with a faster enemy or charge up and go for a body shot.  You can carry out a quick scope uncharged headshot if the scout is going to get close to you, but for a Heavy, often times you need to charge up, even if you are going for a head-shot.  On the other hand, if you are going for a faster enemy your best bet is to go for one uncharged headshot, or two quick body shots.  The only classes that you can't kill with a zero charged headshot with the sniper rife are Solider, Pyro, Demoman and Heavy. You can also oneshot kill a Scout, Engineer, Medic, Sniper and Spy with a 100% charge if you think it's a better bet than the head.  If it's a Soldier, Demoman or Pyro, charge about halfway before taking the shot.    If you're using a bow, you don't need to worry as much about when to charge.  Basically, if you're not sure, charge up and go for a bodyshot.    
You can carry out a quick scope uncharged headshot if the scout is going to get close to you, but for a Heavy, often times you need to charge up, even if you are going for a head-shot.   On the other hand, if you are going for a faster enemy your best bet is to go for one uncharged headshot, or two quick body shots.   The only classes that you can't kill with a zero charged headshot with the sniper rife are Solider, Pyro, Demoman and Heavy. You can also oneshot kill a Scout, Engineer, Medic, Sniper and Spy with a 100% charge if you think it's a better bet than the head.   If it's a Soldier, Demoman or Pyro, charge about halfway before taking the shot.    Basically, if you're not sure, charge up and go for a bodyshot.      If you're using a bow, you don't need to worry as much about when to charge.  