Weapon grouping allows you to group weapons, so you can fire them all at once and at the same target. You should pretty much always do this as long as you're sure you'll only be shooting at one target and using only one type of ammo. If you are going to be shooting at multiple targets or using multiple ammo types, you may want to make multiple weapon groups.
It doesn't put multiple weapons in the same high slots or anything, that would be silly. Weapon grouping is simply a way for you to fire all the guns on your puny rifter at that massive titan by pressing just one button, as opposed to furiously mashing three buttons all at once. It gets more helpful as you start getting in ships that can fit more guns.
You might need to do this if the FC requests to have two sets of guns, eg. on the Alpha doctrine where artillery may be split into two groups of guns shown in the picture above, in order to shoot one target while locking the next.
Instructions:
Note: the game might glitch and refuse the stack the weapons sometimes. If you do not notice and error message when attempting to stack your weapons, try invoking a session change (i.e. swap ships, jump through a gate if you're able) and attempt to stack the weapons again.