A wandering domain for a diffeomorphism is an open connected set whose iterates are pairwise disjoint. We endow A^n = T^n x R^n with its usual exact symplectic structure. An integrable diffeomorphism Φ^h, i.e. the time-one map of a Hamiltonian h which depends only on the action variables, has no nonempty wandering domains. The aim of this paper is to estimate the size (measure and Gromov capacity) of wandering domains in the case of an exact symplectic perturbation of Φ^h , in the analytic or Gevrey category. Upper estimates are related to Nekhoroshev theory, lower estimates are related to examples of Arnold diffusion. This is a contribution to the quantitative Hamiltonian perturbation initiated in previous works on the optimality of long term stability estimates and diffusion times; our emphasis here is on discrete systems because this is the natural setting to study wandering domains. We first prove that the measure (or the capacity) of these wandering domains is exponentially small, with an upper bound of the form exp(-c e^(-1/2nα)), where e is the size of the perturbation, α is the Gevrey exponent (α is at least 1, α=1 for analytic systems) and c is some positive constant depending mildly on h. This is obtained as a consequence of an exponential stability theorem for near-integrable exact symplectic maps, in the analytic or Gevrey category, for which we give a complete proof based on the most recent improvements of Nekhoroshev theory for Hamiltonian flows, and which requires the development of specific Gevrey suspension techniques. The second part of the paper is devoted to the construction of near-integrable Gevrey systems possessing wandering domains, for which the capacity (and thus the measure) can be estimated from below. We suppose that n is at least 2, essentially because KAM theory precludes Arnold diffusion in too low a dimension. For any α>1, we produce examples with lower bounds of the form exp(-c e^(-1/2(n-1)(α-1))). This is done by means of a coupling technique, involving rescaled standard maps possessing wandering discs in A and near-integrable systems possessing periodic domains of arbitrarily large periods in A^(n-1). The most difficult part of the construction consists in obtaining a perturbed pendulum-like system on A with periodic islands of arbitrarily large periods, whose areas are explicitly estimated from below. Our proof is based on a version due to Herman of the translated curve theorem.