Yeah, it depends. I generally paint things when it's easiest to reach them, and when it seems to make sense to me to paint. So for interiors, it's before and during assembly, and before closing the model up. With something like a ship, I'll paint small items and attach them later, after large areas are painted. Same thing for cars-from the inside out, as assembly proceeds, and when it makes sense to me.
As far as gluing surfaces go, I also like to have them clean, especially styrene, but I use the old technique of scraping surfaces to remove paint and reveal the bare surface, for best adhesion.
Most extreme case of cleaning surfaces was when I stripped the chrome from the chromed sprues in the Monogram Red Baron hot rod kit. I knew I would have to clean up seams and sprue gates, so I wanted bare styrene. I used SuperClean to strip the chrome, by the way, and Krylon Chrome to paint those bits as I went along.