First, there is no need to worry about your cat being a problem for the hens. We have yet to hear about any problems between cats and hens.
For dogs, it depends on their individual personalities. Some dogs are fine right away while most take about a week of training for you to become comfortable enough to allow them to share the yard with the hens unsupervised. A select few take longer than a week. Some dogs take longer in between certain steps but they all get there eventually.