Sun is one of the star with a planetary system. Such stars are forming a structure called as galaxy. All such galaxies are outcomes of the expansion of the matter which was confined at a single point. This expansion process is named as "big bang" and is considered the origin of the universe.
Big Bang Theory
\(14\) billion years ago, the whole universe was inside a \(1000\) times smaller bubble than a pinhead, and their density and temperature are unimaginable. Suddenly it got expanded, and the present universe has emerged with space, time and matter. 
The universe expands from smaller than an atom to larger than galaxy in a fraction of time. At a rapid phase still, it is growing. The temperature of the universe is dropped below \(1\) billion degree Celsius in the space of \(3\) minutes. As a result of nuclei's combined together with electrons, atoms have emerged. At that stage of the universe's evolution, it was packed with clouds of hydrogen and helium gas. Highly dense dark matters gradually drew giant clouds of hydrogen and helium, resulting in first galaxies, stars, and everything else seen today.
History of the Universe
Big Bang
\(10^{-43}\) s
\(10^{32}\) K
Space and Time Existed First time
\(10^{-35}\) s
\(10 ^{27}\) K
Exponential Expansion known as Inflation
\(10^{-6}\) s
\(10 ^{13}\) K
Quarks combine to form Neutrons and Protons.
\(3\) minutes
\(800\) million K
Neutrons and Protons formed Helium nuclei (Big Bang Nucleosynthesis)
\(3,80,000\) years
\(3000\) K
Helium and Hydrogen atoms are formed by the interaction of Helium and Hydrogen nuclei with Electrons
\(1\) billion years
\(15\) K
Stars are begin to emerge
\(14\) billion years
\(2.725\) K