Must one know the entire Torah?
only if you can do it (hilchos talmud torah 3:1) (if you can not do it (know the whole Torah) probably you should get married right after 13)
What does knowing the entire Torah mean?
the whole torah she'bal pe - which is all of the halochos in a short way - which it the explanation of all of the 613 mitzvot with their conditions and details, and the details of the sages (hilchos talmud torah 3:1)
Can one get married even if he does not know the entire Torah if he is about to be 20?
yes, but if you are doing it only to do the greatest mitzvah of being fruitful and multiplying then you do not have to, until you finish learning the whole Torah,
but if the reason you are getting married is also to avoid sexual thoughts (that over power him), you should first get married, since the torah learning needs to be in a pure way (hilchos talmud torah 3:1)
PS the reason for first learning the entire Torah is so that he will do it, since 2/3 years after marriage the support of his family is a heavy yoke and he will not have time to do it. (so you can push off the greatest mitzvah of being fruitful and multiplying temporarily, to finish the mitzvah of learning the whole torah (in the past usually by 20 people it was done))
also see kuntes aharon 3.1
rambam talmud torah 1:5
A person should always study Torah and, afterwards, marry. If he marries first, his mind will not be free for study. However, if his natural inclination overcomes him to the extent that his mind is not free, he should marry, and then study Torah.
None of the other mitzvot can be equated to the study of Torah. Rather, the study of Torah can be equated to all the mitzvot, because study leads to deed. Therefore, study takes precedence over deed in all cases.
The verse states: “Fear of the Lord is pure, it stands forever” (Psalms 19:10). Rabbi Ḥanina said: This is referring to one who studies Torah in purity; for such a person the Torah will remain with him forever. What is this; what does it mean to study in purity? One first marries a woman and afterward studies Torah. Since he is married, his heart will not be occupied with thoughts of sin, which could lead him to become impure.
Similarly, marrying a woman is also of utmost importance, as it is stated with regard to Creation: “He created it not a waste; He formed it to be inhabited” (Isaiah 45:18).
rambam ishut 15.2-3
The mitzvah of being fruitful and multiplying is incumbent on the husband and not on his wife. When does a man become obligated to fulfill this mitzvah? From the time he reaches seventeen (since he can still finish the whole Torah before the support of his wife and children is great). If he reaches twenty and has not married, he is considered to have transgressed and negated the observance of this positive commandment (since he already knows the whole Torah). If, however, he is occupied with the study of Torah and absorbed in this endeavor and is hesitant of marrying, lest he be forced to work to support his wife and thus be prevented from studying Torah, he is permitted to delay marriage (even if he already knows the whole Torah). For a person who is occupied in the performance of one mitzvah is freed from the obligation to perform another. Surely this applies with regard to the study of Torah.
When a person's soul desires [to study] Torah at all times and is obsessed with its [study] as was ben Azzai, and clings to it throughout his life, without marrying, he is not considered to have transgressed.
[This applies] provided a man's natural inclination does not overcome him. If, however, his natural inclination overcomes him, he is obligated to marry, even if he has already fathered children, lest he be prompted to [sexual] thoughts.