"Ancient pattern military sniper rifle. Bolt action. Long range, great accuracy and power."
The sniper rifle is a considerably heavy, bolt-action weapon in RimWorld with very high damage; a very slow fire rate; very long range; and good overall accuracy, although poor at touch range.
Due to its exceptionally high damage per shot, the sniper rifle is a very dangerous weapon to be up against - but also a very useful weapon to have - if you have a shooter that can properly utilise it - as it can handily separate limbs from one's body, or even outright kill said victim in one shot - although the risk of both of these events is significantly reduced with some decent protection.
As the sniper rifle has a very long range and also long time between shots, it's important that the wielder of this sniper rifle isn't just competent, but actually a good shot: 98% post-processed accuracy is really the ideal minimum here, which is achievable with a level 12 careful shooter; level 14 ordinary shooter; or level 19 trigger-happy. 98.5% or greater would be preferable though (level 14 careful shooter; or a level 17 ordinary shooter). 97.5% (10 careful; 12 standard; 16 trig-happy) is the bare minimum to somewhat effectively utilise the sniper rifle at 36 tiles and below.
The sniper rifle can be bought from outlander combat suppliers or towns, or an orbital weapons trader - or looted from downed/dead pirates and mercenaries. Sniper rifles can also be manufactured at a machining table once the machining research has been completed, for 60 steel; 8 components; and 55000 ticks (917 secs) of work.
Conclusion & Comparison
The sniper rifle is an excellent weapon for dealing with siege attacks as it can reliably pick people off from a distance, so long as (as aforementioned) the shooter is also up to the task. Not only can your pawns attack enemies preemptively and potentially kill several before they get close enough to fight back, but you can also target their artillery shells and mortars in their camp; causing them to explode, damaging or killing anyone nearby, and potentially starting a wildfire. In the latter case, the fire alone can wipe out the whole camp if the raiders don't move and the weather is clear - although sieging raiders will generally attempt to extinguish fires within their camp.
Compared to its 'little cousin', the bolt-action rifle, the sniper rifle is a bit of a wildcard: you're trading speed and accuracy for significantly increased range and damage, but all changes overall favour the sniper rifle. It may be a better idea to stick with a combination of bolt-action rifles and assault rifles for close-mid range combat in the early-mid game though until you get enough people in your colony that are competent at violence, as the sniper rifle is somewhat of a niche weapon.
The below graphs assume an unmodified shooter using a Normal quality weapon.