Questions to ask yourself, which may help diagnose the problem.
How often does it go out and what is going on when it does?
Is frequency increasing?
Does pilot light stay lit after releasing the pilot button and turning knob to "ON"?
If "yes"-- Probably not the thermocouple.
Is heater a power vent model that vents out a sidewall versus up the chimney?
If "yes"--- Could be wind blowing out the pilot. (Have a client who started having this problem right after he built a fence near the vent. Problem went away when I installed a metal wind deflector on the vent.)
Is heater vented up the chimney and problem only happens on very windy days?
If "yes" -- Could again be wind and you may need a chimney cap, some type of wind deflector, or maybe it's just something to keep an eye on when weather is very bad.
Are children playing near the heater?
If "yes" -- Could again be wind. Doesn't take much to blow out the pilot. (Have another client who had this problem. He roped off an area four feet around heater, told children that was off limits, and problem went away.)
Is a fan or any other type of appliance being used that could be blowing on the water heater? (Had this one too. Cleints dryer vent came apart and air was blowing at the heater. Every time they used the clothes dryer, pilot light went out.)
Is there a lot of clutter around the heater?
If "yes"-- Could be the pilot is starving for oxygen.
How old is the heater?
Maybe a bad gas valve. May not be economical to repair heater and time to just replace it.
Look for the simple things first.