This is a subject that comes up now and then on the excellent Kids RPG mailing list.
Conventional wisdom seems to be that, while it depends on the child, on average kids should be seven or eight years old. They've got the attention span to stick with a game, and can get into the story behind it. Younger than that and they get distracted easily and tire of the game sooner.
This answer has a lot of hidden assumptions, such as what sort of role playing you're planning on doing. They're assuming you're using a system, probably with dice, that has structure associated with it, etc. Using "adult" role playing with kids.
If we relax our definition of role playing and get down to essential, kids are ready and willing to role play at a much younger age. My daughter surprised me by inventing role playing herself when she was a couple months shy of three years old. Actually, I suppose what she invented was a form of live action role playing.
It's easy to call what she did as "let's pretend", and dismiss it as not being "real" role playing. But the essence of role playing was there.
She and I interacted with characters who existed only in her imagination, and she was mostly responsive to changes I would make in the scenario she was building. Now and then she had definite ideas about how it should go, and she'd railroad me into following her plans. But most of the time she adjusted the plot based on responses I had the characters make.
Sometimes we used miniatures, in the form of her stuffed animals, dolls, and toys. At other times winged horses flew around the house, and we'd have to catch them and put them into cages to keep them from getting stuck on the ceiling.
One scenario she had a lot of fun with was getting stuck under a kitchen chair. It was a typical problem solving scenario, where I as the player would come up with plans for getting her unstuck. I'd describe the plan in great detail, and she'd rule on whether it worked or not. She liked the game so much, she kept getting stuck under that chair and rerunning me through the scenario. And of course, what had worked previously failed to work in subsequent runs.
We used elephants to lift that chair, we cut a whole in the floor from the basement, we tied balloons to the chair to float it off her, we used olive oil to grease her up and slide her out, we invested money in a long-term money market until time travel was developed and then bought a ticket back in time to keep her from getting stuck in the first place, etc.
By the end, she had me stretching for ideas, just like a good GM.
The consistency of a role playing scenario is in all her play. We may not use dice to resolve actions, and we don't sit around a table, but she is clearly running us through a plot of her own design. She's creating and managing the events, and is willing to share the GMing duties with me. I have a feeling that "adult" role playing might be a bit too constraining for her later, since she so naturally does a free form version all her own.
Role players who have children, if you're waiting for your kids to get old enough to sling dice, take a step back and see if they're not already role playing right in front of you.
To get involved in discussions about role playing with kids, join the Kids RPG mailing list.