All items that the player has on hand will be located in the Bag and, after Generation I, being placed in the appropriate pocket automatically. Prior to Generation IV, the items pocket had only 20 (42 in FireRed and LeafGreen, 30 in Emerald) spaces for items, while the other pockets had space for any and all items that would go there. If an item to be picked up would be placed into the items pocket, however, and the pocket was full, it could not be picked up until the player had deposited some items into the PC. This problem no longer exists in Generation IV and beyond, where all pockets have enough space for every item.
So that means after Generation 4 (Generation 6) each pocket has enough space for every item
Source Bulbapedia