The word “Gentile” comes from the Latin word Gentes, which means “nations or tribes”.
This goes back to a common theme throughout the Old Testament. Many passages refer to non-Jews by simply calling them “the nations” (in Hebrew, the Goyim).
One example is Isaiah 49:6:
6 He says, “It is too small a thing that You should be My Servant
To raise up the tribes of Jacob and to restore the protected ones of Israel;
I will also make You a light of the nations
So that My salvation may reach to the end of the earth.”
That line “I will also make You a light of the nations” could also be translated “I will also make You a light to the nations”.
So, “nations” is sometimes just a catch-all term for all non-Jews.
When Jerome was translating the Bible into Latin in the late 300s AD, he chose to translate “nations” as Gentes in most places. Over the centuries, this developed into the English word “Gentile”. And you can even sometimes use it to refer to a non-Christian nowadays.