The eternal question: to glue or not to glue before painting? In general it's best to leave pieces with separate colors apart so that you can minimize masking, and sometimes it's impossible to paint some area after you glue them, e.g. the inside thigh of a standing figure. However be aware that it is possible to ruin a paint job during gluing. Sometimes you must glue and putty before painting too, if the parts are broken in the middle of an exposed limb. Consider these factors and plan ahead. Overall I consider the final assembly stage the most risky - the oppotunity cost is so great!
Before you apply epoxy or super glue, clean off the gluing area so that the bare resin is exposed. I usually use lacquer thinner on q-tip. Don't soak the qtip withthinner without squeezing off the excess, or the thinner will run and you'll scream as you see your beautiful paint job ruined! Sometimes I also use the back of the xacto knife to scrap off paint.
Common glue for resin are superglue (CA glue) or epoxy glue.
Superglue dries fast but is brittle. It doesn't stand shear forces well and will break. It decomposes over time (years) Also it's not good for filling large gaps. For these reasons, they're not reliable for gluing major areas. They're more suitable for small objects, or places that are unlikely to get "attacked" or bumped, or areas that requires instant attachment. I also use them to glue the pin into the hole:
The tube thing is manufacturered by Pacer. It allows very controlled dispensing of superglue. Pacer also makes Zip Kicker which reduces the drying time of superglue to practically instantly. The thing comes in a spray bottle, but don't use it. Instead pour the liquid into a jar and use some rod/spatula to grab a very small amount from the jar, and dip that to the superglue.
Epoxy glue is much stronger. It usually comes in part A and part B which you mix in 1:1 ratio to get a glue. There are "5-minute epoxy" or "30-minute epoxy" indicating the amount of time you can work with, and 30-minutes is stronger than 5, but obviously it takes longer to bond. I don't recommend those Devcon "patent pending" twin tube stuff, it never works. I bought Z-poxy from Pacer. They come in squeeze bottle, but the part A bottle clogged up and won't squeeze anymore. Instead, I recommend you just open the darn bottle and drip a skewer into the bottle and get one slob of liquid from it, then smear the liquid on a piece of plastic wrap. Get another slob from part B and mix. Usually a slob unit is accurate enough for a 1:1 mix. I usually mix 30 seconds to a minute with 5-minute epoxy.
One potential hazard with epoxy is you applied too much... the extra just oozes out! If the amount is small you can use some paper towel with water to wipe it away. Epoxy dissolves in alcohol too, so if you're not painting in Mr. Color or acrylic-based paint, you can use alcohol to completely clean the excess.