I am confused with the underlined statement. I thought the electrons determine the number of orbitals, charges determine the spin, and the electron itself is determined by the nucleus.
No. Not quite right. We now understand completely the periodic table. Basically no two electrons can be in the same quantum state.* All have an intrinsic spin (up or down) so every quantum state with "quantum numbers" can hold two. These states are distinguished by their quantum numbers. (It has been a long time so I make make some erros, but you will get the idea.)
Most important number is "n" = 1,2,3, ... and is the Shell index or crudely distance from the nucleus, (but not on any linear scale) with n=1 being the lowest energy level and closest to the nucleus.
Then the electon's angular momentum usually called "L" which is also quantized. (Actually lower case "l" is used, but that looks too much like 1 so I am using capital L here.) L can take values 0,1,2,3... but must also satisfy L < n. so for the first shell, with n= 1 only L = 0 is allowed.
Thus H has its electron in the n =1 & L = 0 and He does have two of these electrons and then the n = 1 shell is full. (I am only speaking of the "ground state" - if the hydrogen is "excited," then any n is possible.) Lithium has 3 elecrons, these same two in the n = 1 shell and the third must go in the n =2 shell but now there are two possible values of L (0 & 1) and they differ slightly in energy, especially in a magnetic field.
To fill the n = 2 shell, you need two of the l = 0 electrons (one up other down) so this is the 4 electron atom, Breylium (I think). It has the same outer shell as He, but entirely different chemisty as the n =2 shell is not yet full.
Now I must tell a about a third way electons can be different, i.e. still another quantum number, usually called "m" which can take both + and - values but |m|= or < L is required so the atom with 5 electrons has the new one in the n =2, L = 1 and m = -1, 0 or 1 state. (these state do not differ in energy except when in a magnetic field, but there always is a very weak one from the magnetic moment of the nucleus if that is not zero.) Same is true for atoms 6,7, 8, 9 and 10. Then this n = 2 shell is full and you have Neon.
I will not write all down these first 10 electron configurations (their quantum numbers) but note that I have already explained the first four. Here is 3 or half (say for spin up) of the remaining 6:
All 6 have n=2 and L= 1:
one is with m =-1
another is with m = 0
and the third has m = 1
Now after neon you must put the next electron in the n =3 shell. I will leave it as an exercise to you to complete this shell up to the next "noble gas" or "closed shell" or argon. hint there are 8 possibilities for n=3 that all are unique in their other quantum numbers (when up and down) are included or four more ways consistent with the rules of the game to make sure that at least L or m are not both the same for the n= 3 shell.
At the n= 4 shell m = -2 thru m = 2 are also for possible while L=3 and remember L may be 2, 1 or zero also I think this gives 18 different and unique psoosibilities, for the n = 4 shell (and of course you still have the 18 inner (n =3 or less) posibilities so the next noble gas, Kripton, has 36 electons and of course it nucleus has 36 protons plus a a few more neutrons as all these protons repelling each other need more neutrons so the "strong force" can hold them to gether.
After that is gets too complex for you to work out. Before the n= 5 shell is "really" full, some of the n = 6 L=0 states are actually lower in energy and your next electrons to add go there, instead of finishing then= 5 level. Later as you again begin to stuff electrons into n=5 or "inner shells" and leave the outter most shells unchanged, you get a whole series of elements with essentially the same chemisty. - Thus these are hard to separate chemically and (i think) are ,called the "rare Earth series"
as I said, I probably have made some mistakes, but that is the basic story of how nature builds up the periodic table, why noble gasses all have low chemical activity (they are the "closed shells" - will not give or accept an electron easily) etc.
These shells and configurations are sometimes called the "electron orbitals" sort as if they were orbiting the nucleus.
The L values 0,1, &2, are sometimes (for historical reasons - spectroscopic data designations before any of this was understood) called S, P, & D. regardless of their states "n values." (but of course the D ones only exist if n = 3 or greater. etc.)
To more directly answer your question (but now without just saying "that is the way it is" as I have explained why):
The size of all atoms is set by the outer most shell which has any electrons in it, and the number of electrons in it (especially wrt how many have just populated it or how many it just lacks from a "closed shell") force the chemistry to be similar. For example, all of the atoms with missing only one electron from forming a closed shell are very strong acceptors of that missing electron (Chemist call them "oxidizers" - Florine is the strongest) Oxygen is also and "oxidizer" but not as strong as Florine as it lacks two to complete that shell.
I hope this at least gives the idea. Explaining at least the first half of the periodic table is a simple part of quantum mechanics all can understand, but you will need to accept the rules about how the quantum numbers are limited instead of derive them, as can be done with a deeper understanding.
---------------------------
*This is called the "Pauli exclusion principle" and comes from the math of quantum physics. (It is true for all "Fermions" or spin = 1/2 particles not jst electrons, but they are the most important, or at least the common, ones.)