G-quadruplexes (G4) are secondary structures formed by guanine-rich nucleic acid sequences and shown to exist in living cells where they participate in regulation of gene expression and chromosome maintenance. G-quadruplexes with solvent-exposed guanine tetrads show the tendency to associate together through cofacial stacking, which may be important for packaging of G4-forming sequences and allows for the design of higher-order G4 DNA structures. To understand the molecular driving forces for G4 association, here, we study the binding interaction between two parallel-stranded G-quadruplexes using all-atom molecular dynamics simulations. The predicted dimerization free energies show that direct binding through the 5-G-tetrads is the most preferred of all possible end-to-end stacking orientations, consistently with all available experimental data. Decomposition of dimerization enthalpies in combination with simulations at varying ionic strength further indicate that the observed orientational preferences arise from a fine balance between the electrostatic repulsion of the sugar-phosphate backbones and favorable counterion binding at the dimeric interface. We also demonstrate how these molecular-scale findings can be used to devise means of controlling G4 dimerization equilibrium, e.g., by altering salt concentration and using G4-targeted ligands.