When you enter the password you give it to your windows OS and avast can then also see it

quote from avast

For WiFi connection Windows disclose the information about the network, that you are connected to, including its password. So the scan gets the info from Windows and then evaluates the password strength (based on some standard password evaluation algorithm). If the password is marked as weak, the "Weak wireless network password" vulnerability is reported.

It evaluates more then just length, but also the characters composition (capital, lower case, numbers, special characters, …) and even checks against some dictionary attacks.

If it determines the password is weak, it the displays the detection network scan results and displays the weak password (as hidden dots) in the detail, but you can view it by clicking on those dots.

However Avast does not store the password. It is only available for viewing in the scan result.