It was around 380,000 years after the big bang, when the universe cooled enough to the point where stable neutral atoms were able to be created. This major event was called Recombination. Prior to this point, electrons were unable to bond with atomic nuclei because they were moving around at high speeds. Even when they bonded, random photons blew them away again.
Photons are particles representing light and carry energy. Before Recombination, the universe was dark and opaque. This was because electrons that were floating around absorbed all the photons. But afterwards, the universe became transparent because the photon were than able to travel freely through the universe.