As you might expect, it means to be very mad but who is a hatter and why is he so mad?
Firstly, a hatter is another name for a hat maker or miliner. Many years ago, when all hats were made by hand, hats would be handstitched and held together with the aid of hat pins. These pins passed many times throughout the day from hat to hand and mouth in order to keep both hands free. Unfortunately, being made from mercury, the pins were highly toxic leading to eccentric and insane bahaviour.
Some argue that this is exaggerated but the myth became sealed and imortalised by Lewis Caroll in Alice in Wonderland and the Mad Hatter's Tea Party.
A variation is As mad as a March hare. March being the month and a hare being something like a large rabbit. They are famous for strange behaviour in the spring.
Well, here they both are together in quite a scary adaptation of the famous Lewis Caroll story.
Don't think your English is bad because being mad, The Hatter makes no sense at all!
As mad as a Hatter!