Some samples of the MacBook Pro mid 2010 were made from parts with a Latent Defect. The problem was there from the beginning, but did not become prominent until later versions of Mac OS X were installed, an external display was used, or other activities caused increased graphics switching.
Apple eventually developed a test, the VST Test, that ran for as long as 12 minutes before detecting the problem, found out which batches of chips were defective, and offered to replace the mainboards or re-imburse the cost to replace the board for owners that could run the test and have it detect this specific problem. The program ran for a limited duration, and is now long gone.
The permanent solution is to have the graphics chip replaced (not just same chip re-soldered) by a shop that has the tools and expertise to do surface-mount chip replacements. Other solutions mentioned here will reduce, but not eliminate the problem.