A) If your pilot is on, then it isn't the thermocouple. It may be a gas valve, regulator, or a flame sensor issue.
B) if the pilot will light but not stay on then it is a thermocouple issue.
C) If you don't have a pilot (a flame) but instead have a hot surface igniter (red glowing piece), see probable issue A. It may be a gas valve, regulator, or flame sensor issue.
There are other, less likely, issues that could cause this, but from the description it seems a low probability. I wouldn't rule them out without having a technician check it first.