The most likely cause is graphics card overheating, but especially with a CRT monitor you might (also) have some hot spots inside the monitor. Either can cause unstable pictures after running for a while.
Some, but not all, graphics cards have a heat sink and fan on them. Nearly all CPUs recently have a heat sink and fan. While the CPU isn't likely to cause the problem described, if one is dirty enough to affect cooling it wouldn't be a bad idea to check both and, if necessary, clean out the crud.
If the fan on either is removable without removing the heat sink it's usually a good idea to pull the fan off and clean the fins on the heat sinks. Most such "coolers" blow air onto the heat sink fins, so that's where the crud accumulates. Often, with the fan in place it may look clean when there's quite a lot of gunk inside (on the other side of the fan).
If you have to actually remove the heat sink (i.e. if it's integral with the fan) it's very important that you apply a proper "heat sink grease" when re-attaching the sink, especially for the CPU cooler. Your CPU will burn itself up without a proper grease coating, if one is needed.
Most recent computers monitor CPU temperature, and if it exceeds expected limits will shut down your computer and give you an error message to the effect of "Your computer has been shut down due to a thermal event. Check your cooling systems." (Messages vary.)
In the absence of an error message, it most likely is the graphics card, with the monitor second most likely. Unless you have an exotic "gamer card" a replacement graphics card might be the best fix, since a card that begins "shutting down" due to heat is probably "cooked enough" to continue to fail. Fairly decent cards are available from $20 - $80 (US) the last time I looked, depending on what you need. (Exotic cards can run up to $400 or more, but you probably don't need one of those.)
For some computers with "integral graphics" - i.e. on the motherboard, you might have to move a jumper to disable the old graphics; but usually you can just disable the old one in Control Panel and let the computer "discover" the new one when you reboot - assuming that you have a slot available to plug a new card into.
Flicker will sometimes happen due to a bad capacitor or leaky diode in a CRT monitor, but most shops consider CRT monitors "not economically repairable." Since some of the internal components can hold kilo-Volt charges long after being unplugged, and "capacitor memory" can recharge those voltages even if you short them out to discharge them, attempts at internal repairs are not recommended if you don't have a very good idea what you're doing (and/or an excellent insurance policy to take care of your loved ones when you're gone).