Shapes draw their names from their design, patterns and/or orientation. The number of sides in a 2D shape define the name of that shape. Most of these names are originally borrowed from other languages such as Latin and Greek into the English language.
A triangle is named so because it has three sides. “Tri” is borrowed from Latin meaning “three.” The prefix “Hexa” drawn from the Greek language means “six”. Therefore, a hexagon has 6 sides.