We study the mechanisms of the gravitational collapse of the Bose-Einstein condensate dark matter halos, described by the zero temperature time-dependent nonlinear Schrödinger equation (the Gross-Pitaevskii equation), with repulsive inter-particle interactions. By using a variational approach, and by choosing an appropriate trial wave function, we reformulate the Gross-Pitaevskii equation with spherical symmetry as Newton's equation of motion for a particle in an effective potential, which is determined by the zero point kinetic energy, the gravitational energy, and the particles interaction energy, respectively. The velocity of the condensate is proportional to the radial distance, with a time dependent proportionality function. The equation of motion of the collapsing dark matter condensate is studied by using both analytical and numerical methods. The collapse of the condensate ends with the formation of a stable configuration, corresponding to the minimum of the effective potential. The radius and the mass of the resulting dark matter object are obtained, as well as the collapse time of the condensate. The numerical values of these global astrophysical quantities, characterizing condensed dark matter systems, strongly depend on the two parameters describing the condensate, the mass of the dark matter particle, and of the scattering length, respectively. The stability of the condensate under small perturbations is also studied, and the oscillations frequency of the halo is obtained. Hence these results show that the gravitational collapse of the condensed dark matter halos can lead to the formation of stable astrophysical systems with both galactic and stellar sizes.