Usually you're okay to have them together for up to 4 months. Some bucks are rowdier than others, so if you do choose to keep them together that long, keep a close eye on them. Generally speaking, does don't go into estrus until they're about six months old and bucks don't get rowdy until 4 months, but there have been exceptions.
When I am introducing a new goat into my herd, it generally isn't under 3 months of age. I have them in different pens but beside each other so they can't hurt each other but can sniff and even posture to each other. The new goat is kept in separate housing at night as well. After a week, if they are getting along beside each other, I'll put the new one in with the herd in the pasture and watch to make sure s/he is accepted or at least isn't getting beat up too much. If that goes well for a few days, I put them in the goat house together. Again I watch and am prepared to yank the new one out if needed.
Doing it this way usually takes about two weeks to introduce a new goat, but it has been working very well and keeping everyone safe.