I usually try to move them to the main coop as soon as I can (less work for me), usually between 3-6 weeks. I've done it a few ways....
1) slowly move their outdoor brooder closer to the coop over a 1-2 week span. Then move the brooder into the coop. They're pretty good about going home after that. Then after about 3-7 days of that, I remove their brooder. Sometimes a few will cheep loudly because they can't find their brooder, but some will have already found a roost and a place near the big chickens and won't care at all.
2) Move them into the main coop after they've gone home to their outdoor brooder. On the second or third day, deny them access to their outdoor brooder, and force them to find the main coop by themselves. Some will need coaxing and be physically moved into the coop. Usually by the fourth day, they will all go home by themselves. Sometimes 1 or 2 might hover and perch outside. Definitely all will go home to the big kids' coop by themselves by Day 6 or 7.
Please note that my big chickens already "know" the babies well before the move. I usually start moving babies into the yard in an outdoor brooder by the time they're 2 weeks old. When the weather is warm I brood all babies on my patio. They either get supervised patio-only free range time or access to the baby run right away (semi-supervised in case one escapes). Then after about 2-4 weeks of protected interaction with the rest of the flock, I let them completely free range with the rest of the flock. This way, by the time I move them into the main coop, they don't get too harassed by the older chickens. I mean, there's the usually pecking order stuff, but no one is horribly mean to the babies.