Sniper is an amazing carry late game, and a fairly flexible hero in general. Sniper can be a ganker, a solid lane hero, a (bad) middle or jungler if there isn't a more appropriate option. He is very easy for beginners to play but still has enough complexity for more advanced players to experiment with. There are some things that must be kept in mind when playing him. He is absurdly squishy, he has no inherent escape, and even in late game (without a very specific item build) he will die quite easily. Do not underestimate him though, he can out range towers and right-click the tankiest heros to death.
I prefer to build right into a Wraith Band for the stats, then aim for Boots. Once I have those I prefer to buy a Shadow Blade so I have some escape. Next I buy a Yasha for the Agility After that I work on Power Treads and a Desolator. Once you have a Desolator the game is pretty much over. I usually have time for a Manta Style before the Ancient is destroyed, and I often have bought a Crystalys as I work towards a Daedalus. One time I made it halfway to a Butterfly, but that is truly rare. As far as situational items go, if you're having trouble with really aggressive enemies in your lane harassing you I buy a Morbid Mask before the shadow blade, then keep it until I have bought both the Mithril Hammers I need for my Desolator (remember Treads and Yasha first). Heart if you have the cash to splash and need the health, though you should probably buy a Butterfly with that money, Boots of Travel are always good, so is a Black King Bar or Linken's Sphere. If you really really want to you can go Satanic, but only if someone else is carrying your team and you simply need help with team fights. A Mjollnir is great because you can use it with a Desolator or Satanic, and is a good move against heroes like Chaos Knight or Meepo. Eye of Skadi and/or Sange and Yasha are good if you're trying to gank but people keep escaping. Force Staff or Blink Dagger for if you have an invisible hero on your team or they just carry dust religiously and you need another escape.
The only reason I have a Clarity on Sniper is for Shrapnel. It is the only way Sniper can own middle lane, it is good for pushing towers, harassing, making space, setting up ganks, pushing lane, getting vision, it's just good. It will, however, chew through your mana, be fairly ineffectual against late game heroes, and you will basically only use it for creeps and vision.
Headshot is great because it is a 40% chance to mini stun and auto hit with bonus damage, great for farming and killing.
Take Aim is so good. By level two you can out range towers, by third level you can harass heros hiding behind towers, and the final level can get you kills before you are even visible to the enemy.
Assassinate is great for securing kills, but there are some downsides. It freezes you in place, is subject to magic resistance, and the damage falls off in the late game. But if you target someone with it you get true sight on them, and it mini stuns on hit. It needs to be kept up to date every chance you get or it will be next to useless.
You can hypothetically jungle with sniper if you get a morbid mask, but this isn't really a good idea unless you are getting no farm in lane.
As Sniper you are not in a team fight and should never be in a team fight. You should always be just on the edge of a team fight using your increased range to focus down threats and keep important heros stun-locked. Also, at the first sign of trouble you have one job: Run like the cowardly snot you are. No, you cannot save them, no you cannot take them on your own, not even one on one, unless you are under tower or you are super fed late game, and even then don't try it. You are not a hero, you are a sniper. Also beware of dust.