Children start developing an accent when they start speaking. Not wanting to sound overly patronising, but isn't that bleedin' obvious?
I remember reading somewhere that speech is formed in different parts of the brain in children and adults, which is why you can't learn a different language without having an accent as an adult.
The language acquisition bit of the brain largely degrades from the age of 12ish, which is why kids younger than this can pick up new languages without much effort, but it is increasingly difficult as you get older. As I recall (undergrad level linguistics but, er, some years ago) they'd established this effect but I'm not sure they'd pinpointed it to specific areas of the brain. More research may have been done since then however, so what I just said could quite easily be utterly wrong. Glad I could help.
On accents, one thing that is interesting is the way some accents seem to cling on harder than others - I know some northern Englishers who moved to London and sounded like extras from Eastenders within months, but a Glaswegian who'd lived there for twenty odd years still sounded very, very Glaswegian.