A closure in programming is a function that captures the variables from its surrounding environment, allowing it to access those variables even after the surrounding function has finished executing. This concept is commonly used in languages like JavaScript to create private variables and functions within a larger scope. Closures are powerful tools for creating modular and maintainable code by encapsulating data and behavior within a specific context.