This phrase is often used as a euphemism. If you want to refer to someone who is rather strange, but you want to say something polite-sounding about them, you'd say 'He's a bit of a character'. And as Richie says, teachers would generally describe a cheeky or even badly behaved or difficult child as being 'a character'.