We give in this paper topological and dynamical characterizations of mathematical quasicrystals. Let U denote the space of uniformly discrete subsets of the Euclidean space. Let A denote the elements of U that admit an autocorrelation measure. A Patterson set is an element of A such that the Fourier transform of its autocorrelation measure is discrete. Patterson sets are mathematical idealizations of quasicrystals. We prove that S in A is a Patterson set if and only if S is almost periodic in (U,T), where T denotes the Besicovitch topology. Let chi be an ergodic random element of U. We prove that chi is almost surely a Patterson set if and only if the dynamical system has a discrete spectrum. As an illustration, we study deformed model sets.