"How long" will be dependent on how rapidly your fitness improves. But I would encourage you to run a 5k or 10k race every 3 weeks. Consider also doing a track session during non-race weeks. I am a fan of repeats 5k target pace. Start with 4 x 1,000m. Or 5 x 800m.