I think I am going to give a lecture here.
The point is that you should know WHY you ferment in primary.
And that is not only for the foam that is forming.
Pulp fermenting is done to extract all kind of things from the skins and fruit flesh.
Things that are extracted are sugar, acid, color, flavor and tannin.
Now some things are extracted in water or juice.
Other things are extracted in alcohol.
So when you pulp ferment you try to extract as much goodies as possible. At first it is done by the juice and when fermentation starts the goodies are also extracted by the alcohol that is made by the yeast.
Too long a pulp ferment will leach too much tannin in a wine.
That is a problem with for example elderberry wines, and off course some other wines.
So when you pulp ferment an elderberry wine and you do not press and transfer in 3 to 4 days your wine will be very tannic and needs to age a long time before it gets drinkable.
Too short a pulp ferment is easily demonstrated:
red grapes will make a blush wine when just pulp fermented for a short time.
So when to transfer to a secondary:
Any time afther the vigorous fermentation subsides (no foam anymore) and the winemaker seems fit.
There is however no upper limit.
There are french wines that are made by extended maceration.
Meaning that even if the wine is dry it is left in a primary soaking on the pulp for extracting more tannin, colour, flavor etc.
This is off course done with a lid on and an airlock.
The time this extended maceration is done varies from days to even a few months.
So shortening the answer:
Transferring from primary to secondary is done when the winemaker decides it is time to do so.
Remember each must is different, so has to be treated accordingly.
This is where the men are distinguished from the boys