Within the same population, individuals often differ in how they respond to changes in their environment. A recent series of models predicts that competition in a heterogeneous environment might promote between-individual variation in behavioural plasticity. We tested groups of sticklebacks in patchy foraging environments that differed in the level of competition. We also tested the same individuals across two different social groups and while alone to determine the social environment's influence on behavioural plasticity. In support of model predictions, individuals consistently differed in behavioural plasticity when the presence of conspecifics influenced the potential payoffs of a foraging opportunity. Whether individuals maintained their level of behavioural plasticity when placed in a new social group depended on the environmental heterogeneity. By explicitly testing predictions of recent theoretical models, we provide evidence for the types of ecological conditions under which we would expect, and not expect, variation in behavioural plasticity to be favoured.