How many languages were there before the Tower of Babel was built?

There was only one language.

And the whole earth was of one language, and of one
speech. Genesis 11:1

And the LORD said, Behold, the people is one, and they have all one
language. Go to, let us go down, and there confound their
language, that they may not understand one another's speech.
Therefore is the name of it called Babel; because the LORD did there
confound the language of all the earth. Genesis 11:6-9

There were many languages.

By these were the isles of the Gentiles divided in their
lands, every one after his tongue. Genesis 10:5

These are the sons of Ham, after their families, after
their tongues. Genesis 10:20

These are the sons of Shem, after their families, after
their tongues. Genesis 10:31