Assuming you're not talking about competition/tactical reload magazines... otherwise 56hawk's advise is the winner.
Years ago, when powders were much dirtier than they are now I got in the habit of cleaning mags about every 300-500 rds with most guns... although with LSWCs in a 1911, I might go every 200 rds. These days... I think you can probably get away with twice the above. Different guns and ammo may dictate different cleaning schedules.
If you want to disassemble them for inspection (I mention this because there are lots of folks that either never clean magazines, or just spray them now and again), get a test tube or BRM type brush and bend it so that it's a snug fit front, back and sides.
You can spray them clean too, but sometimes you can get some pretty hard to remove carbon on the insides of the feed lips.
C