It could be a thermocouple but first take the whole pilot assembly out and disassemble it. Clean it very good (compressed air is ok) especially the orifice inside the pilot horn. You may just have a weak pilot. If the flame is in good contact with the thermocouple and problem still exist, then change the thermocouple. I believe in doing the free things first.
Answers & Comments
It could be a thermocouple but first take the whole pilot assembly out and disassemble it. Clean it very good (compressed air is ok) especially the orifice inside the pilot horn. You may just have a weak pilot. If the flame is in good contact with the thermocouple and problem still exist, then change the thermocouple. I believe in doing the free things first.