The main question - What does it mean for the Father to "give" people to Jesus?
Jesus goes on to answer that, starting from the very next verse after the one you quoted. I will highlight that, and related statements in the rest of the chapter (all quotes from the A.V.):
"And this is life eternal, that they might know thee, the only true
God, and Jesus Christ, whom thou hast sent... I have manifested thy
name unto the men which thou gavest me out of the world : thine they
were, and thou gavest them me; and they have kept thy word. Now they
have known that all things whatsoever thou hast given me are of thee.
For I have given unto them the words which thou gavest me; and they
have received them, and have known surely that I came out from thee,
and they have believed that thou didst send me. I pray for them. I
pray not for the world, but for them which thou hast given me; for
they are thine. And all mine are thine, and thine are mine... Holy
Father, keep through thine own name those whom thou hast given me,
that they may be one, as we are... Neither pray I for these alone, but
for them also which shall believe on me through their word." (up to vs
20)
In that selection, "giving" and being "given" is stated seven times by Jesus, but there are another seven times in the whole chapter. Thus, the entire chapter needs to be studied to grasp what the sense of the Father giving, and Jesus giving amounts to. Only then can this question be answered.
What I suggest is that the sense of continuous flowing between the Father and the Son is fundamental to this chapter. And all of this glorifies God, with the astonishing revelation (vs. 10) that those people the Father gives to the Son glorify the Son! "I am glorified in them" Jesus says! This is all bound up in the concept of "being one". Those the Father gives to the Son "may be one as we are" (vs. 11). So, the Son glorifies the Father, and the disciples of Christ whom God gives him, glorify the Son, which (in turn) results in more glory to the Father, for the Father and the Son are one.
This is where biblical doctrine about the impossibility of knowing the Father or the Son in a saving way apart from Father and Son combining in their sharing of their love to the saved has to be grasped. And vs. 20 is highly significant. Jesus' word to the disciples given to him back then is believed by those chosen disciples, and they in turn state that word to others, who believe it, and are saved. That is why Jesus' prayer reaches into the future to all those who would yet believe because they too were given to Christ, the Father knowing they would believe on Christ through the disciples' word.
Here is a significant quote about the importance of those the Father 'gives' to Jesus throughout the centuries, having to stand in the apostles' doctrine, which is the doctrine of Christ. This is exposition as to what Revelation 21:14 means, that the heavenly city of New Jerusalem has "twelve foundations, and in them the names of the twelve apostles of the Lamb.":
This foundation is the doctrine of Christ without which none has
either the Father or the Son 2 John 9
"Whosoever transgresseth, and abideth not in the doctrine of Christ,
hath not God. He that abideth in the doctrine of Christ, he hath BOTH
the Father and the Son."
This is that upon which the entire ecclesia rested by faith in the
beginning: 'And they continued steadfastly in the apostles' doctrine',
Acts 2:42. It is called the evangel, or gospel: 'I am not ashamed of
the gospel of Christ: for it'- mark that, it; it itself - 'is the
power of God unto salvation', Romans 1:16... That which brings the
salvation or deliverance is the apostolic doctrine of the gospel, or
evangel, called 'the faith once delivered to the saints', Jude 3...
'Hold fast the form of sound words, which thou hast heard of me', II
Timothy 1:13 ...In 'the foundations of the apostles of the Lamb' are
found 'those things which are most surely believed among us', Luke
1:1" (The Revelation of Jesus Christ, p 598, John Metcalfe)
The Father 'gives' to Christ those who will believe Christ's words, which words have come down to us through the centuries as the apostolic doctrine of the gospel of Christ. They belong to Christ by faith, by the indwelling of the Holy Spirit. All who have been 'given' to Christ are identified by the indwelling Holy Spirit. Romans 8:1-27 explains this miracle of grace. Those ones can be called Christians. They have not self-identified as Christians. They have been identified as such by the indwelling Holy Spirit who is given to them as their guarantee of forever being with Christ. Then they have that quiet assurance that the Father has given them to Christ, "joint-heirs with Christ... sons of God".
That's what it means for the Father to 'give' people to Jesus. And, (your secondary question) given how Jesus prayed in John ch. 17 only for those the Father had already, and would yet, give to him - and not for the world - it is plain that those who belong to the world are not included in those who are given to Christ.