For example, an ion has 8 number of protons and 5 number of neutrons. There is more number of protons (+) than neutrons (-), therefore the ion will have a positive charge. Vice versa, if there is more number of neutrons than number of protons, means the charge will be negative.