Muggings and pickpocketing can happen at any time in Barcelona - particularly the latter, as the thieves there are among the wiliest in the world. But yes, you are especially a target when you're leaving the bars/clubs, especially at the crazy late/early hours that many aren't accustomed to. You tend to be off your guard after you've been partying all night... and even more so if you've been partying 'til dawn!
If you're partying toward the water in Barceloneta, where many of the clubs are, be on your watch for the hookers as you're headed home. Often, this is up the Ramblas, either to the many hostels there, to the newer hotels toward Paseig de Gracia, or the metro station waiting for the first train. They often latch on to you like there's no tomorrow, so instead of engaging them, just ignore them and keep walking. Or have a girl with you. They rarely bother you if you're already with a girl.
The tight/twisted turns of the Ciutat Vella (old city) can be a bit disorienting, and some muggers/pickpockets take advantage of that, so be careful barhopping or walking home around the area. Particularly in Raval, the more run-down portion that, if you were facing the ocean and the Columbus statue from the Ramblas, would be to your right.
Another place to be a little more aware of your surroundings is on the metro. You'll notice that even the locals wear their daypacks/bags/etc. in front of them once they get into the station. The Estacio-Stants train station is also on the notorious side.
The main thing is to just keep your wits about you in these areas and try not to stick out like too much of a sore thumb. Barca is one of (IMO) the most beautiful, worthwhile cities in the world, and your experience there shouldn't be marred by these things. Just remember that because so many people think it's worth visiting, so do the thieves! Enjoy...