It's always a hard choice, no matter what you grow. When do you draw the line, how long can the fruits still grow and accumulate nutrients.
An approximation of a known crux.
When it comes to specific areas in agriculture there are different rules that seem to occur when it comes to harvest time. When you grow cucumbers they are said to be over-ripe when they turn yellow. In the web you find different opinions, some say you can't eat it at all when it turns yellow, some say the fruit is unbearable bitter or and some quote the fruit gets sour or even 'sweet-ish'.
From my own experience i can say that for me most of the yellow cucumbers tasted kind of sour, but with a wide variation of sourness-extent. Only when the fruit itself also get's soft and squishy i really don't recommend cutting and opening it. That#s really a good indication of the fruit being over-ripe.
Nevertheless there are some rules and considerations you can think about harvest-time. Of course the plant also just wants to procreate, live long and spread it's genes. An overripe fruit suggests the plant that there are no natural distributors of it's seed. So it has to think of an own way to spread it's seed. Depending of the design of the plant/organism it has developed a system to do that during it's evolutionary development.
check this fellow cucumber out for example. It doesn't even need another organism to spread it's seed. When it's overripe the fruit explodes and spreads it's seed automatically.
The same thing is valid for harvesting mushrooms. It is said that if the mushrooms looses its spores, the mycelium is receiving signals that it should stop growth and developing of fruits. So a lot of experienced mushroom-growers state, that you should harvest before the caps of the shrooms get too big and open their gills. There are even rumors circulating in the web which state, that in case of spores being dropped on the substrate colonized with mycelium you should rinse it off with water in order to give the mycelium the impulse to develop fruits again.