Most of the time, when I use a variable array, size 1 is enough for the variable.
But when I used a Unit Group array, It didn't work until I increased the Array Size.
Which kinds of variable do I have to increase the sizes?
It really depends. By default, all the other slots will return "null" if you try to refer to them (for strings: "", booleans: false, integers: 0, reals: 0)
You just have to know how you're going to use it. In your case, you have to define a size because you need to use the groups as is. You are adding units to the groups. However, if you create groups on your own (e.g. "Units within 500 of some point"), then you don't need to have that sizing (you're going to end up creating the groups yourself). The "size" part is just telling the editor to initialize N slots of the array (starting at 0) with some default object.
In the case of groups, it is an empty group. So if you need an empty group at that slot, feel free to modify the variable size. If you are going to make one yourself, then just keep the size as 1 or 0.
There isn't really a cookie-cutter solution on when to use it and when not to use it. For example, with an effect array--you'll end up creating the effects yourself so you don't need to increase the size field. However, if you are using groups where you just need to add units, then you need to set the size (otherwise you'll add units to a null group [does nothing]).