Dispersal is a life-history trait that can evolve under various known selective pressures as identified by a multitude of theoretical and empirical studies. Yet only few of them are considering the succession of mating and dispersal. The sequence of these events influences gene flow and consequently affects the dynamics and evolution of populations. We use individual-based simulations to investigate the evolution of the timing of dispersal and mating, i.e. mating before or after dispersal. We assume a discrete insect metapopulation in a heterogeneous environment, where populations may adapt to local conditions and only females are allowed to disperse. We run the model assuming different levels of species habitat tolerance, carrying capacity, and temporal environmental variability. Our results show that in species with narrow habitat tolerance, low to moderate dispersal evolves in combination with mating after dispersal (post-dispersal mating). With such a strategy dispersing females benefit from mating with a resident male, as their offspring will be better adapted to the local habitat conditions. On the contrary, in species with wide habitat tolerance higher dispersal rates in combination with pre-dispersal mating evolves. In this case individuals are adapted to the ‘average’ habitat where pre-dispersal mating conveys the benefit of carrying relatives’ genes into a new population. With high dispersal rates and large population size, local adaptation and kin structure both vanish and the temporal sequence of dispersal and mating may become a (nearly) neutral trait.