In some contexts, abstract stimulus representations can effectively promote the pursuit of reward, whereas in others, more detailed representations are needed to guide choice. Here, using a novel reinforcement-learning task, we asked how children, adolescents, and adults flexibly adjust the specificity of the representations used for learning based on experienced reward statistics, as well as how the specificity of these learning representations influences subsequent memory. Across two experiments (total N = 224), we found that children, adolescents, and adults flexibly up- and down-weighted more detailed versus broader stimulus representations, depending on the reward structure of the environment. The representations used for learning shaped mnemonic specificity; placing greater weight on detailed representations during value-guided learning enhanced subsequent memory for stimulus details, while placing greater weight on broader, categorical representations enhanced memory only for categorical information. Moreover, the relation between learning and memory strengthened with age; relative to adults, children demonstrated reduced coupling between the specificity of the representations used for value-based choice and the specificity of their subsequent memories. Our work demonstrates that from early in life, reward shapes the granularity with which the world is partitioned, which in turn exerts an increasing influence on how experiences are remembered into adulthood.