Since you have tagged this with “American government,” I will discuss this in that context. The term “smoking gun” can be used in any context to refer to a piece of evidence that is absolute proof that a particular person has committed a particular crime. The idea is that the person is still holding a gun with smoke coming out of it, showing that they were the one who just shot the gun.
In terms of American government, this term was first used during the Watergate era. During this time, there was a great deal of controversy over what President Nixon knew about the cover-up and when he knew it. Nothing could be proven until the “smoking gun” tape was found on which Nixon could clearly be heard to make statements that showed that he knew about the cover-up activities.
Ever since then, the term has been in use when there are scandals and in other situations as well. President Bush talked about needing to attack Iraq even without proof that Iraq had WMD because he did not want the “smoking gun (proof that Iraq had them)” to be a “mushroom cloud (from a nuclear attack on the US).”