I'll second and emphasize Carol's advice. You need to hold the button in until it will stay lit. How long does that take? Well, lets see - its the 21st Century now, and ...
Actually, it often takes anywhere from 30 seconds to well over a minute after the flame starts before it will STAY lit after releasing the button, and each unit will have its own "personality" and will act just a wee bit differently. After a few times, you will get to know yours and you will know if it needs 30 seconds, one minute, a minute and a half or whatever