We present a general model for the growth of weighted networks in which the structural growth is coupled with the edges' weight dynamical evolution. The model is based on a simple weight-driven dynamics and a weights' reinforcement mechanism coupled to the local network growth. That coupling can be generalized in order to include the effect of additional randomness and nonlinearities which can be present in real-world networks. The model generates weighted graphs exhibiting the statistical properties observed in several real-world systems. In particular, the model yields a nontrivial time evolution of vertices' properties and scale-free behavior with exponents depending on the microscopic parameters characterizing the coupling rules. Very interestingly, the generated graphs spontaneously achieve a complex hierarchical architecture characterized by clustering and connectivity correlations varying as a function of the vertices' degree.