Atoms are made up of protons and neutrons in the nucleus, and electrons surrounding the nucleus in shells. Protons have a positive charge and electrons have a negative charge, so for an atom to have a neutral charge there needs to be an equal number of these two. Neutrons and neutral anyway (the name is a hint!) so they don't have an effect on charge - their only purpose is to physically separate the positive charges of protons in the nucleus, so they don't all repel each other.
To draw the structure of a specific atom (here we're doing Magnesium), we need two numbers from the periodic table; the atomic number and the mass number (the bigger of the two numbers). Atomic number tells us the number of protons in the atom, and as we discussed before the number of electrons will equal the number of protons in a neutral atom - so now we know both of these numbers! The mass number is the sum of the number of protons AND neutrons in the atom, as we know the number of protons (from the atomic number), all we have to do now is subtract that from the mass number to find the number of neutrons. Finally, to draw the atom, we fill in the nucleus with neutrons and protons, and electrons fill the outer shells sequentially.