As far as plants go, forever. For ingestion by humans two years is tops as long as 1/4 cup of bleach has been added to that amount 3X3X3 feet? The chlorine evaporates rapidly when the tank is opened to the air or water is drawn off and allowed to sit before drinking. Plants do not worry about disease and digestive disorders. If the water collected isn't used for a few months I would drain it and clean the tank and add fresh water, a bit of bleach and it will be fine for both humans and plants. Just in case humans needed the water as well.
I would use a tiny bit of bleach for water collected for watering plants anyway. Rain water is by no means sterile or drinkable. We used to eat 'snow cones' with sugary syrup. No more. That snow is full of worms...eeeuuuww!
Where I live, Oregon state, it is ILLEGAL to collect rainwater! I am so serious. Check the laws where you live. Just to hide illicit water collecting behavior and structures! Anxious grins?