This is a houserule
The section on Critical Hits states:
When you score a critical hit, you get to roll extra dice for the attack's damage against the target. Roll all of the attack's damage dice twice and add them together. Then add any relevant modifiers as normal. To speed up play, you can roll all the damage dice at once [...]
Note that you only roll the attack's damage dice twice, nothing else is doubled, such as modifiers, and no additional dice specifically occur when using a magic item. This is also explained in the following two questions:
Also, no part of the section on Magic Items states that they have this special property on a critical hit. Your GM saying that a +n longsword rolls (2+n)d6 is a houserule, and a rather strong one at that as it makes magic items even more powerful than they already are.
It also is rather strange because it means a 1d4 weapon will not benefit as much as a 1d12 weapon; normally one weapon could roll 2d4 on a crit and another 2d12, but with this houserule one could roll 5d4 and another 5d12. These are much farther apart in terms of their expected damage. Going from a difference of 8, to a difference of 20.
Your GM may be applying a rule that did exist in 4th-edition (thanks to Carcer for pointing this out):
All magic weapons and implements give you an enhancement bonus to your attack rolls and damage rolls when you use them to make an attack [...]
All magic weapons and implements deal one or more extra dice of damage on a critical hit. The number of extra dice is equal to the item’s enhancement bonus [...]