Both of them are used when talking about one item or one person (singular). The main difference between the two is DISTANCE.
THIS (singular) is used for an object or person that is physically very close to the speaker (the plural form of THIS is THESE). If you look at the woman in the picture above, she can literally touch the slice of cake in front of her. She doesn't need to walk over to it. Therefore, she says I WANT THIS ONE.
THAT (singular) is used for an object or person that is more distant to the speaker (the plural form of THAT is THOSE). He or she must point to it and can't just touch the object or person without moving closer to it. The boy in the picture above needs to walk over to the cake in order to get the cake.
You'll see from below that if you're standing in front of one object (singular) or many objects (plural) we would use THIS and THESE.
If you're standing far from one object (singular) or many objects (plural), we would use THAT and THOSE.