How late in the summer can you expect to get ripe tomatoes in your garden? I am in the southern NY area?
If your tomatoes aren't protected in a greenhouse, then the first frost will mark the end of your tomato season. Tomatoes are tender plants that will be injured or killed even by light frosts. For frost dates by location, see Farmer's Almanac. Your last and first average frost dates provide an estimate of your annual growing season, and the months tender plants like tomatoes will likely be safe from frost in your garden.
In my experience with indeterminate tomatoes in zone 5a of central NY, the fruits will continue to grow and ripen as long as the plant is alive and uninjured by frost. However, there are always loads of unripened tomatoes by the time the first frost comes. This is why it's recommended to harvest your green tomatoes before the frost and try to find a use for them, like fried green tomatoes or salsa verde.
If your green tomatoes freeze and thaw, their shelf life will be drastically shortened to almost nothing, but if you nab them before they freeze, they should last many days inside.
I've had ripe slicing tomatoes as late in my zone 5a garden in Wisconsin, but they weren't terribly flavorful. Note that tomatoes don't ripen once temperatures get below 50 deg F. Once temps get that low, it's recommended that firm green or pink tomatoes be brought inside for ripening. See here for some details.