I'm looking at hooking up some rain barrels using PVC piping. Is there a certain type of PVC that would be best to use for this, considering that it will be exposed to sun/rain/heat/cold? Lots of people seem to use "regular" white PVC but I didn't think that was intended for outdoor use.
All PVC is subject to UV light degradation. PVC without UV protection will eventually suffer a loss of impact resistance. Your pipe will be whole, until impact at which it will shatter or crack instead of flex.
Some PVC (PVC UVR) is UV resistant. The sunlight still damages the PVC pipe, but it is in a matrix of other chemicals that compete for the UV light (stealing it away from the would be damaged PVC). PVC UVR will degrade, but at a slower rate.
Thicker wall pipe will take longer to fail, as the UV will be caught by upper layers before penetrating lower layers. Painted pipe will not fail, provided that your paint blocks or reflects UV light (and nearly all paints do).
You are right, a lot of people use PVC pipe, but mostly it is meant to be used in buried applications (where it will be shielded from UV light); however, most of those buried applications come out of the ground at some point. Typically the out-of-ground portions are not properly protected, which is just a timer for eventual failure.
Sometimes that's due to ignorance, sometimes people rationalize that PVC is so cheap the pipe repair in the future will be cheap too. Save yourself the headache of doing it twice, paint your PVC.
You could try the gray colored Schedule 80 PVC pipe. This is a much heavier duty material that will stand up to being outdoors. It is recommended by manufacturers. such as U.S. Plastic Corp, that PVC pipe and fittings be painted after installation with a coat of white water based latex paint to provide for UV resistance. The UV light is what is part of the sunlight that can degrade PVC.
Link to manufacturer PVC Pipe Catalog: http://www.usplastic.com/catalog/item.aspx?itemid=23979&clickid=redirect