The fruit needs to get to a mature size so that the growth hormones evolve to ethylene production which is what turns the tomato fruit from green to red. Once it hits that point, it will turn red even if you take it off the vine.
This puts tomatoes into the category of “climacteric” fruit, in that they continue to ripen after they are picked (like bananas).
We become experts at timing harvest here in the Canadian Prairies. Growing in a greenhouse gives you a few extra weeks of on-the-vine growing. Water buckets and / or a small space heater can get you through many below-freezing nights during the shoulder season. In 2020, I pulled my last tomatoes from the greenhouse just before Halloween.