In this Thesis I studied the formation of the four giant planets of the Solar System in the framework of the nucleated instability hypothesis. The model considers that solids and gas accretion are coupled in an interactive fashion, taking into account detailed constitutive physics for the envelope. The accretion rate of the core corresponds to the oligarchic growth regime. I also considered that accreted planetesimals follow a size distribution. One of the main results of this Thesis is that I was able to compute the formation of Jupiter, Saturn, Uranus and Neptune in less than 10 million years, which is considered to be the protoplanetary disk mean lifetime.