First, there is nothing that was told in the movies about the lightsaber colors, so all information on the subject came from extended universe.

The color of the lightsaber come from the crystal used in it's construction. It's a personal choice based on multiple factor like crystal availability, traditional color for a Specialization (undermentioned as class) or just a personal color preference.

Out of universe, the Blue / Red distinction was made during post-production when the lightsaber blades were being rotoscoped, as the original blades were simply white. The color choice might have been influenced by the political climax, the red color being traditionally associated with Soviets and blue with Americans, but also note than the colors reversed for blasters and spaceships. Luke's green lightsaber was added late in post-production of the Return of the Jedi in order to better stand out against the blue sky of Tatooine in outdoor scenes. So all those signification / explanation are all retcon.

I made a digest of the meaningful passages of the Lightsaber crystal entry on Wookieepedia (emphasis mine).

While the Jedi used natural crystals, the Sith often used red-hued synthetic crystals. Sith-made synthetic crystals create a slightly more powerful blade when energized by the dark side of the Force, occasionally demonstrating the ability to "break" Jedi lightsaber blades, disrupting the energy circuit and shorting out the weapon. However, this rarely happened, and as synthetic crystals demonstrated a slightly lower amount of maneuverability, this advantage was very slim. [...] Around 4,000 BBY, lightsaber crystals were used to indicate a Jedi's chosen class. Blue indicated a Jedi Guardian, a Jedi who used the Force on a more physical level. Green indicated a Jedi Consular, a Jedi who preferred to reflect on the mysteries of the Force and fight the dark side at its heart. Yellow indicated a Jedi Sentinel, a Jedi who honed their skills in a balance of combat and scholarly pursuits. This distinction fell out of practice in later years when most Jedi used blue or green crystals, based on the supply on the various source worlds. Purple, yellow, and orange crystals were still used by some Jedi until the the fall of the Jedi Order, but they were exceedingly rare, and often passed down through generations. [...] For millennia, the Jedi Order lit lightsabers in every color and hue imaginable. However, following the Battle of Ruusan, the hues of most available crystals had been limited to either blue or green.

For the out of universe section, this quote is taken form Lightsaber Entry, Behind the scenes - Color section on Wookieepedia (emphasis mine)