Does this mean that whenever the function P(x) is true, then x is an element of X, and when P(x) is false, then x is not an element of X?

I'm confused because the wording says that "...a sentence P(x) that is either true or false whenever x is any particular element of X..." which leads me to believe that whether P(x) is either true or false, then it is still an element of set X.

Or is it saying that there is a set within X in which P(x) is true, and there is also another set within X in which P(x) is false?

The set [itex]\{x\in X~\vert~P(x)\}[/itex] are all the elements of X which satisfy P. So, in particular, we want all elements to lie in X.

Maybe some examples may help you to see the concept:

[itex]A=\{x\in \mathbb{N}~\vert~x~\text{is even}\}[/itex]
This means that we take all the elements of [itex]\mathbb{Z}[/itex] which are even. So the elements of our set A are precisely 0,2,4,6,8,10,12,...

[itex]B=\{x\in \mathbb{Z}~\vert~x>0\}[/itex]
This is the set of all positive integers. The set consists out of 1,2,3,4,...
Note that x=1/2 also satisfies x>0. But 1/2 does not belong to B because it doesn't satisfy [itex]x\in \mathbb{Z}[/itex].

[itex]C=\{x\in \mathbb{Q}~\vert~2x+2=0\}[/itex]
This is the set of all rational numbers x such that 2x+2=0. The only number satisfying that is of course -1. And this number is in [itex]\mathbb{Q}[/itex], so it belongs to C.

So this set consists of all elements in [itex]\mathbb{N}[/itex] which are larger than 0. Clearly, this is the entire set. So D is not a proper subset in this case.