I think it depends on your setup and your weather. I went about it a LOT differently than bobbi-j said and it worked out well for me. I moved my girls to their coop at 2 weeks old and finished brooding them IN their coop. The overnight lows were above 70 degrees and I put the brooder lamp in there with them. The coop is a fortress and they were very safe. I blocked off the nest boxes and put a 'baby' perch in there for them to practice on. I cleaned the coop every few days (replacing litter but keeping some old) and spent a lot of time out there with the coop doors open socializing with them.
I kept them in the coop 24/7 for three weeks straight before I let them out in the run. And when I did it wasn't all at once - just an hour that first day, and then I gradually added more time each day to get them used to it. By the time they had access to the run all day they were so used to the coop being 'home' that I didn't even have to train them to go in there when it got dark - they did it automatically.
I don't think there is a 'right' way to go about it. Do what works best for you.