They can be a few weeks apart. I got 6 that were 13 weeks & 4 that were 9 weeks. Until they were fully grown they would hang with their age group while free ranging. Kind of like humans. I'd have 6 in one part of the yard & 4 in another. I'd get all the same age they will be easier to watch if your free ranging.
I found that if they are close to the same age they don't bicker as much or for as long when you introduce them to each other. And if you get them all from the same place and they were already together, then there will be no fighting.
I wish I had been able to get chicks that were all the same age. I don't think my flock suffered, but it did make it hard to judge their development, since there were a couple of weeks difference in some of their ages. Looking back, I can see how that could make a difference.
I recommend getting day old chicks same age. They get along better as a group from the beginning. You can handle them a lot so they will come to you later. The brooder time goes fast and is really fun if you have the time. You get more attached to babies I think. It's warm now so you can brood them outside with a heat lamp in the coop or garage. It is risky gettin older chickens--they can have a disease or have problem behavior that gets passed on to you, and they won't get along with young chicks. I got chicks 2 weeks apart because people told me they would get along in the same brooder, but they didn't and are still separated in the coop by a fence slowly to be combined.
In my experience, it's also a lot harder to feed them if you have chickens of different ages. You will have to buy two different types of feed, then separate them at feed time. If you want eggs sooner rather than later, I would buy all hens or pullets. The chicks are very cute, but A LOT of work. I've found that I can bond equally well when I've "adopted" older chickens, you just have to spend a lot of quality time with them and offer plenty of treats.