I am starting a pet project that involves Raspberry Pi 2 and I was wondering. What is the maximum amount of GPIO modules I can connect to a Raspberry Pi 2? I Basically my question does not involve only the amount of GPIO pins that the pi has but also regarding power. If the power that RPI2 takes in is only 5V how many modules can it support?
Each "thing or wire" you connect to a GPIO pin will act as a current load or source. That is, they will pull current from the rPI GPIO pin or try to source current into the pin. Lets say, for ease, that the thing connected to the GPIO pin is acting as a load, wanting to pull current from the pin. The rPI GPIO pin has a maximum current sourcing capability that you need to understand. Once you know how much current the GPIO pin can source (or sink), then you can get a handle on how many loads you can put on that one GPIO pin. You don't want to exceed the maximum current load capability of the rPI.
Another thing to pay attention to is the capacitive loading you apply to the GPIO pin. Each digital load or source you apply to a GPIO pin also has a bit of capacitance associated with them. Putting many loads on a GPIO pin increases the total capacitive load and thus will distort and corrupt the slew rate of the rPI GPIO pin, not to mention meeting minimum CMOS voltage thresholds for the pin. The effect could be that devices on the GPIO pin don't see a valid logic signal. You may be turning the GPIO pin to a logic 1 but the devices don't see a valid logic 1 level. An oscilloscope can help you here during debug, to look at your signal and make sure the logic levels and slew rate are correct.
Your question doesn't really make a lot of sense. There is no "maximum number".
As long as none of your boards require conflicting uses of the same GPIO pins, and you don't exceed the maximum supply current of the GPIO power rails (USB power supply current minus board draw on 5V line [so, depends on your power supply, probably in the 500-1500 mA range], and I think 50 mA on the 3.3V line) then it's fine.