Elements in the same horizontal row are in the same period. The periods are numbered from top to bottom. The period number is the same as the number of occupied electron shells.
The ions formed have a full outer electron shell, so are very stable. See the study guide on groups in the periodic table for more information.
The picture shows a close-up of one carbon atom. A hydrogen atom has one proton as the nucleus and one electron in the region outside the nucleus. The electron and proton are attracted to each other.