The word "all" in 1 Timothy 2 most likely refers to "all types of people," or "all classes of people," since the word "all" is used earlier to refer to types/classes of people, such as "kings and all who are in high positions" (1 Timothy 2:2
Some argue that 1 Timothy 2:3-6
3 This is good, and it is pleasing in the sight of God our Savior, 4 who desires all people to be saved and to come to the knowledge of the truth. 5 For there is one God, and there is one mediator between God and men, the man Christ Jesus, 6 who gave himself as a ransom for all, which is the testimony given at the proper time.
The word "all" does not necessarily refer to every single person in the world, and in fact, it is arguable that most of the time the Bible uses the word "all," it is not in fact referring to every single person in the world.
In the immediate context of 1 Timothy 2, in verses 1-2, we gain insight into what the word "all" really means. Verses 1-2 say this:
1 First of all, then, I urge that supplications, prayers, intercessions, and thanksgivings be made for all people, 2 for kings and all who are in high positions, that we may lead a peaceful and quiet life, godly and dignified in every way.
Here, we see that examples of "all" are "kings and all who are in high positions." So, the word "all" does not refer to all individual people, but rather to groups, or kinds, or classes, people.
Thus, 1 Timothy 2:4
Likewise, 1 Timothy 2:6
There are other passages in the Bible that help us understand what the terms "all" and "the world" mean within the context of the Bible.
39 Many Samaritans from that town believed in him because of the woman's testimony, “He told me all that I ever did.” 40 So when the Samaritans came to him, they asked him to stay with them, and he stayed there two days. 41 And many more believed because of his word. 42 They said to the woman, “It is no longer because of what you said that we believe, for we have heard for ourselves, and we know that this is indeed the Savior of the world.”
Here, Jesus is "the Savior of the world" in that He is the savior of both Jews and Samaritans. The Samaritans had thought that Jesus came exclusively for the Jews, but they learned that Jesus came for "the world"—or, not just for the Jews.
And they sang a new song, saying, “Worthy are you to take the scroll and to open its seals, for you were slain, and by your blood you ransomed people for God from every tribe and language and people and nation,
This verse tells us that Jesus came to save people from all over the world, people "from every tribe and language and people and nation," not every single person in the world.
For as in Adam all die, so also in Christ shall all be made alive.
Here, "all" clearly does not mean every single person, since Scripture is clear that not every person will be "made alive." The word "all" here is used in a parallel structure. Adam represented all humanity, so in Adam all die, and Christ represents His people, so in Christ "all" (everyone who Jesus came to save) will be made alive.
For the grace of God has appeared, bringing salvation for all people
Here, "all people" does not refer to every single person in the world, but rather to people of all types and classes. Earlier in TItus 2, Paul refers to types and classes of people such as "older men," "younger women," "young women," "younger men," and "bondservants" (TItus 2:1-10
For God so loved the world, that he gave his only Son, that whoever believes in him should not perish but have eternal life.
Here, God giving His son for "the world" is connected with the idea that "whoever believes" in Jesus will be saved. So, here, "the world" refers to "whoever believes," which is not every single person in the world.