Sounds like you need to replace the thermocouple - they have a limited life but usually aren't expensive or difficult to fit. User instructions for your boiler may give advice.
Thermocouple is a safety device which shuts off gas supply for a minute or two until boiler has cooled down enough for supply to be restored safely but it's fail-safe so your pilot won't get any gas if it breaks down.
Bill May
October 2008