An envelope shapes how a parameter - usually volume, but often filter cutoff or pitch too - changes over the course of a single note, rather than staying constant.
The four stages
- Attack: how long it takes the sound to reach full level after a key is pressed. A fast attack gives a percussive, immediate sound; a slow attack creates a gradual swell.
- Decay: how long it takes to fall from that peak level down to the sustain level.
- Sustain: unlike the other three stages, this is a level, not a time - the volume held steady for as long as the key stays pressed.
- Release: how long the sound takes to fade to silence after the key is released.
Beyond volume
The same ADSR shape is commonly applied to a filter's cutoff frequency (creating a classic "wah"-like sweep as a note begins) or to pitch (for effects like a percussive pitch drop). Many synths offer multiple independent envelopes so volume, filter and pitch can each have their own attack/decay/sustain/release shape simultaneously.
Recognizing what an ADSR envelope is doing is one of the fastest ways to understand why a preset sounds percussive, pad-like, or plucky - and it's usually the first thing worth experimenting with when learning to program sounds from scratch.