In oxygen, the number of protons and electrons each are 8. Protons are positively charged while electrons are negatively charged particles and hence make the atom electrically neutral.
Oxide ion is formed when oxygen gains two electrons and thus has 10 electrons but only 8 protons and hence it is negatively charged.