Leon is 21 during the Raccoon City outbreak that opens Resident Evil 2, which takes place in September 1998.
Resident Evil 4 is set in autumn 2004 — six years later — which puts him at 27 by the time he's sent to Spain.