From TF2 Wiki
Sprays are a feature of the PC version of the game by which players can 'spray' their own pictures (Default Key: "T") onto any surface. The image file can be uploaded to your spray list in the multiplayer menu (though note that the image file must be converted into a .vtf file first). There are several sites that offer a variety of TF2 sprays already converted into vtf. format.
Useful gameplay application is almost negligible, though they can sometimes trick the enemy into thinking you have a crouched Sniper , Sentry gun or have placed Sticky Bombs (from a distance) or in some cases even distract the enemy. (See video)
There is a roundabout way to convert images to the VTF format. If you have Half-Life 2: Deathmatch or Counter-Strike: Source installed, run one of them, choose Settings, and then go to the Multiplayer tab if you're in Half-Life 2: Deathmatch. Press "Import Spray". Afterwards, navigate to the folder where the spray is. Select it. Now that it is a VTF, exit the game. Navigate to either your Half-Life 2: Deathmatch or your Counter-Strike: Source directory. Depending on the game, go to either the "HL2MP" or the "CStrike" folder, then the "materials" folder, then the "VGUI" folder, and finally the "logos" folder. Your spray will be in this folder. Cut or copy it, and navigate to the same folder in your Team Fortress 2 directory. Paste it there, and it will be accessible as a spray in the game's menus.