Oxygen typically has a valence of 6, meaning it has 6 electrons in its outermost energy level. Oxygen has a strong tendency to gain electrons to achieve a stable electron configuration with a full outer shell, which is typically 8 electrons.
If oxygen gains 2 electrons, it will have a total of 8 valence electrons. Since electrons are negatively charged, adding two more electrons to oxygen would result in an overall negative charge. Specifically, oxygen would have a charge of -2 when it gains 2 electrons.
The resulting ion would be called an oxide ion (O^2-) and is commonly encountered in various chemical compounds, such as in the formation of ionic compounds like magnesium oxide (MgO) or sodium oxide (Na2O).