Why Soldiers Wrap Their Weapons ?
I'm assuming you're talking about something like this…
There are two reasons why this is done. The former is a bit more ancient now and it will change the color to match the surroundings. But these days a lot of us just spray paint on our guns before heading off. We knew the terrain of the area we were going to operate in so we painted our rifles to match. In general the terrain colors don't vary enough to have to worry about changing the color scheme.
The second reason is to break up the rifle pattern or silhouette. Rifles have a lot of straight lines that go against nature. The human eye is able to form patterns quickly and can select objects that are known unconsciously. The human eye is very good at choosing black and straight lines because it is not natural. This will draw their (enemy) attention to where the army is very quickly. Breaking known patterns helps "snipers" hide/stalk more effectively.
I guess at this point I should go into a bit more detail and answer some of the questions that have popped up several times.
There are some who talk about "shine" or something that comes from a rifle. Most "sniper" rifles are matte or parker in color. This type of coating itself is highly anti-reflective so no additional material is needed to reduce glare.
Wrapping the rifle didn't change the ballistics in the slightest. However wrapping stock where your cheeks go is NOT recommended. It changes the cheek weld (where you place your cheek to see through the scope) and will give you inconsistent cheek placement. This then changes your accuracy. Adding a wrap does not increase or decrease the rifle's accuracy. Nor does it have any effect on the follow-up shot the same way wearing camo pants doesn't make you a faster runner.
Heat dissipation. Will wrapping the gun cause it to heat up faster? Sure but it will take a long time. The likelihood that a sniper would use the rifle to the point where it was warmed up enough to make it important was slim. If it did get to that point, the contact would be very close and a few miles of accuracy reduction wouldn't make a difference.