This is highly variety dependent. Most garden tomatoes can be stored between 3 and 10 days if picked just as they start to turn colors. Cooler is better up to a point. Do not store in the refrigerator and don’t store them anywhere below 45 degrees because it is very bad for flavor. A cool basement is ideal, up on a table. Don’t store them if they are damaged. A worm hole or other damage to the skin will cause it to rot as it ripens.
Tomatoes naturally produce ethylene which causes them to ripen. If they are in a bag or container, they will ripen faster because ethylene accumulates in enclosed spaces. So, on a table in a basement with tomatoes not touching each other is idea.
There are several varieties available with a gene that slows down the ripening process. Winterkeeper is an example. Piennolo is another. They can be stored in a humid basement for between 3 and 9 months.