At various times in the history of Buddhist philosophy there have been debates about whether enlightenment is attained suddenly or gradually - a rather pointless debate admittedly. Whole schools of Buddhism have developed over this issue.
The moment of enlightenment is sudden but the process of getting to that stage is gradual. The Buddha said, ‘Little by little and from time to time the wise person should remove his/her defilements the way a smith removes dross from silver’ (Dhp.239). In another place he says, ‘Just as the ocean slopes away gradually, tends down gradually without any abrupt precipice, even so this Dhamma and discipline is a gradual doing, a gradual training, a gradual practice. There is no sudden penetration of knowledge’ (Ud.54).
See also: Vibhajjavada