Despite extensive research on Assessment for Learning (AfL) in the classroom, the importance of contextual factors as perceived by teachers remains underexplored. This study examines the extent to which elements of the classroom context, in particular heterogeneity, influence the frequency of AfL. Using 2018 TALIS data from 47 countries, this study found that teachers who perceived higher levels of heterogeneity in their classrooms conducted more frequent classroom assessments. The degree of AfL was most significantly influenced by the perception of heterogeneity among academically gifted students, followed by socioeconomically disadvantaged students, immigrant students, students whose first language is different from the language of instruction, and students with behavioral problems. Interestingly, when teachers perceive a higher proportion of low-achieving students, the frequency of AfL tends to decrease. These findings suggest that AfL can be used not only as a tool in circumstances where learning processes are challenging, but also as an approach to understanding and addressing the diverse learning potentials and backgrounds in the classroom.