Often an over heating CPU or GPU is poor heat dissipation. Start with the basics are the vents clear and is the internal fan running? If not you'll need to clean and/or replace the fan as well as the clean the vents & heat sink fins.
If this doesn't help you'll need to replace the thermo paste between the GPU & the heat sink (will likely need to do the CPU as well). Make sure to use a good quality paste.
If that still doesn't help then it's possible you have some other problems which will likely need a new logic board or have a process that is running wild causing the CPU/GPU to over work.