Hi JodyJo, more a guess than anything but I reckon if an egg has been sat on for more than a couple of days I'd be wary about eating it. Especially if your hens have a roo in with them - it only takes 3 weeks for a fertile egg to hatch, so it won't be long before the wee blood speck of an embryo has developed into something large enough that you really wouldn't want to find it in a boiled egg! If you meant how long does an egg have to be under a hen before you can assume it won't hatch... I'd say you should give an egg 4 weeks (especially if you are unsure about the start of incubation) before assuming it is a duffer for sure.
If it's a fertilized egg, I think you see blood veins on the third day that it's being incubated. If it's not a fertilized egg, then it's good for longer. Eggs at room temperature last quite awhile. If the egg is under a hot chicken 24/7, I'm not sure what the longest time is before it will go bad. Others may have some idea.
You can always candle any you find, that you aren't sure about. It lets you see shadows inside the egg, so you can tell if it has any veining or other development inside the egg. If you look in the hatching section of the forum, there should be a thread stickied at the top on how to candle an egg.