Somewhat depends on how strong the stout is, IMO.
I make a Vanilla Coffee Porter that ends up around 5.7% and used 3-4oz of beans depending on the type of coffee beans I'm using, lighter roast = 4oz/darker roast =3oz. I also just add the whole beans into primary (Unless I'm adding coffee to an Imperial Stout or Porter I don't secondary them) and feel this gives the best flavor and aroma, essentially you're making cold brew coffee using the beer instead of water. I only keep the beans in for 24-48 hours, a couple times I have racked off the beans after 20 hours, I don't notice a difference between 20 hrs and say 30 hrs, it comes down to my availability to get it bottled after adding the beans. Anything more than a couple days I have read that some have started to get astringent flavors, I have ventured down that road so I can't comment.