turning it in anytime is OK, even before it flowers, but I do it when it has been flowering but before seed is viable. I think that would be the time when most nutrients and minerals have been extracted and able to be incorporated as compost material to replenish the soil. And the bees get the most benefit. It may also depend on if you need enough time for successive cropping.