If you have any complicated edges on your cabinet, you have to worry about paint pooling if you do it when it is all together. I believe that the ideal method of painting anything complex is to assemble, disassemble, paint and reassemble. It is also more time consuming though.
Otherwise, I would say it is just a matter of preference. Painting after avoids worrying about scratching like Donk mentioned, buy you may need to worry about overspray more if you are spray painting or air painting.
Also, I don't put screws on the outside of my cabinet. Everything is on the inside using L brackets less chance of the wood splitting on me, and I don't have to worry about covering the screw holes with putty.