In "Opie and the Spoiled Kid", Barney says "Of course a really sound safety procedure would be to give each and every citizen of this town a course in Police Identification".
So how long would this take? The accepted population, as shown in a sign in a Season 8 episode, is 5360.
(Otherwise it's WHOOSH and he's gone!)
Well, that would depend on how much time Andy or Barney would have to conduct these courses what with them being so busy out chasing chicken thieves and what not.
From what I am calculating, about a 100 a month for about 50 months or 4 years.
This is proof that Mayberry only had a population of about 500 in the B/W years and then in the summer following Season 5, the coal company (where Violet Rose worked) moved in on the outskirts of town, causing the population to boom and increase 10-fold. No longer content with the quiet life, these new folks craved action! And folks suddenly had all these electronic gadgets (for Emmit Clark to fix), and rich suburbs like Walnut Hills sprang up (Opie Steps Up in Class). Suburban sprawl I'll tell you! Next thing you know everyone's inventing new dances, twitching and jiggling around to rock and roll music (Opie's Group). It was progress, but it came at a cost!
We need to keep in mind that Barney would only have implemented his plan for Mass-PD-ID during the B&W years when he was in Mayberry (pop. 500). Heaven only knows what went on after the population explosion caused by the coal company.
Thus, at 25 a week per class (for the easiest possibility) it would only take 5 months to educate the whole town. Think about the ease of "Sheriffin'" then! When a stranger came to town an alert citizen (certified by the Barney Fife School of Police Identification) could immediately report it to the Sheriff's office, turning in a typed report with all the particulars at the same time. Barney could enter it in his logbook for easy reference later on. Crime-free Mayberry!
The only drawback to this would have been that Barney might have been too busy for rooster-crowing and French-harp playing over the telephone, reading the Police Gazette, or catching a few Z's in the back room. Everything in life's a tradeoff.