Germany classified their vehicles by their roles.
The Panzer II been an infantry support tank later reconnaissance tank
the Panzer III been a medium tank which was intended to be the back bone of their army
the Panzer IV been a fire-support tank, later reclassified as medium tank in replacement of the Panzer III
the Panzer V panther been a cruiser tank
the Panzer VI Tiger been a battle tank
and so on.
Germany did not classify their tanks by their guns but their guns were attributed to their role. Germany in particular, during WW2, was known to be extremely specific for the role intended for each tank.
Japan classified their tanks by the roles as well. the Type 92, Type 95, type 97, Type 98 and Type 1 were all having their role and they had their weight class.
the Type 89 was an medium infantry tank
the Type 92 was a heavy armored car for the cavalry
The Type 95 was an light infantry tank
the Type 97 was a medium tank replacing the Type 89
and so on
they also have battle tanks, cavalry tanks (equivalent to cruisers) reconnaissance tanks, tank destroyer, artillery tanks, propelled guns, and amphibious tanks. they were definitively classified by their role.
there is almost no country who create a tank specifically for their weight. a country who do that would be pretty much not knowing anything about how to use a tank. some tend to get versatile tanks, capable to forfil many roles, some go with extremely specialized tanks for specific role.