You will need 1 gallon for every foot of plant. If your plants are 5 feet tall, you will need a 5 gallon container. Most inside gardens would not need bigger then a 2-3 gallon container. With inside gardens, you have to use grow lights. You quadruple (four times) your output every foot you lower your light. If your plants are more then 3 foot tall then they are not getting light on the bottom. If part of a plant is not getting light the plant will reabsorb the nutrients from the leaves in that area. The leaves will turn yellow then shrivel and fall off, which causes the plant to waste energy that it could be using to produce more fruit & flowers. If you are using Containers for outside gardening then you want to consider things like how fast is the water going to evaporate. The bigger the container the more water it will hold so you will not have to water the plant has much. But if the container is too big, the plants will not seek out the container and you will have wasted Soil/Hydroponic Growing Medium. The best thing to do is to go by how big the plant is and how big the plant will get over time.
Example: You have a pepper plant that is 1 foot tall, you would need at least a 2 to 3 gallon container to start. As the plant gets bigger, you will transplant it again. So if it is in a 3 gallon container and the plant is 4 feet tall you will need a 5 gallon to 7 gallon container. You can just start out with the 5 to 7 gallon container but, the root development will not be as good as if you would have started out with a smaller container first.