The most popular theory is called the nebular hypothesis.
"According to the nebular hypothesis, our Solar System began around 4.6 billion years ago when part of a molecular cloud of interstellar gas, which was filled with particles of ice, dust, rock, and other particles, collapsed. These clouds collapsed from some kind of turbulence that caused it to heat up and eventually turn into a star.
Most of the cloud formed the Sun. Other material from the cloud flattened around the Sun forming a planetary disc. The material from the planetary disc, also known as the solar nebula, went to form the planets and other objects in our Solar System. Some of the material forms a solid object, which gets larger as other particles collide with it and stick together. Eventually, the object gets large enough to attract more dust and ice with its gravitational influence. These balls then form the cores of the planets. If one of these balls leaves the Sun early enough, it turns into a comet. Because of radiation and collision with other objects, these balls of ice, rock, and dust turned into very different planets. Astronomers believe that it took millions of years for the planets to form. Asteroids and other planetesimals are “failed planets” – objects formed from the solar nebula that never got large enough to turn into planets. Currently, astronomers are studying planets forming in other Solar Systems." ( http://www.universetoday.com/38118/how-was-the-solar-system-formed/ )
Solar System Formation
"Scientists believe that the solar system was formed when a cloud of gas and dust in space was disturbed, maybe by the explosion of a nearby star (called a supernova). This explosion made waves in space which squeezed the cloud of gas and dust. Squeezing made the cloud start to collapse, as gravity pulled the gas and dust together, forming a solar nebula. Just like a dancer that spins faster as she pulls in her arms, the cloud began to spin as it collapsed. Eventually, the cloud grew hotter and denser in the center, with a disk of gas and dust surrounding it that was hot in the center but cool at the edges. As the disk got thinner and thinner, particles began to stick together and form clumps. Some clumps got bigger, as particles and small clumps stuck to them, eventually forming planets or moons . Near the center of the cloud, where planets like Earth formed, only rocky material could stand the great heat. Icy matter settled in the outer regions of the disk along with rocky material, where the giant planets like Jupiter formed. As the cloud continued to fall in, the center eventually got so hot that it became a star, the Sun, and blew most of the gas and dust of the new solar system with a strong stellar wind. By studying meteorites, which are thought to be left over from this early phase of the solar system, scientists have found that the solar system is about 4600 million years old!" ( http://www.windows2universe.org/our_solar_system/formation.html )
Some more info:
Content will be erased after question is completed.