A computational study of the self-organization of heteroepitaxial ultrathin metal films is presented. By means of a continuum complex field model, the relationship of the equilibrium surface patterns of the film to the adsorbate-substrate adhesion energy, as well as to the mismatch between the adsorbate and the substrate bulk lattice parameters, are obtained in both the tensile and the compressive regimes. Our approach captures pattern periodicities over large length scales, up to several hundreds of nm, retaining atomistic resolution. Thus, the results can be directly compared with experimental data, in particular for systems such as Cu/Ru(0001) and Ag/Cu(111). Three nontrivial, stable superstructures for the overlayer, namely, stripe, honeycomb, and triangular, are identified that closely resemble those observed experimentally. Simulations in nonequilibrium conditions are performed as well to identify metastable structural configurations and the dynamics of ordering of the overlayer.