We tend to think of the sun when we think of the hottest possible temperatures. The temperature in the sun's interior is estimated to be about 15 million degrees Kelvin. A thermonuclear explosion can generate even higher temperatures, at most about a hundred million degrees Kelvin, but hotter temperatures are regularly achieved during other nuclear fusion experiments.
In 2006, a team at Sandia National Laboratories used the largest X-ray generator in the world to deliver about 20 million amps of electricity through a grid of fine tungsten wires which dissolved into a cloud of plasma, which was then compressed by a strong magnetic containment field. The temperature of this dense plasma reached 2 billion degrees Kelvin, which is about 3.6 billion degrees Fahrenheit. This is the hottest sustained (albeit temporarily) temperature ever achieved on the planet Earth.
Tungsten was used in the experiment because it has the highest boiling point of all the elements, which is 5,811 degrees Kelvin. Prior to the Sandia National Labs experiment, the highest temperature that was ever recorded in the laboratory was at the Tokamak Fusion Test Reactor in Princeton, New Jersey. That was 5.11x10^8 degrees Celsius.
Hotter temperatures are routinely achieved in particle collisions in synchrotron and particle accelerator experiments, but since we are unable to directly measure them their numbers are derived from the energies which we know to be generated during those collisions. These are calculated to be in the trillions of electron volts. We can then convert them to more a more comprehensible format.
A proton accelerated to the speed of light in a particle accelerator will achieve an instantaneous temperature of 10x10^12 degrees Centigrade for a very brief time when it collides with a static target. Temperatures of 10^15 degrees Kelvin are achieved with the world's largest particle accelerators at Fermilab and at CERN.
In order to determine the highest possible temperature that can possibly exist, or has ever existed, we have to establish certain parameters which place an effective limit on this number, so this number can only be exceeded in theory. The problem is that at that temperature, which is generally regarded as the hottest state in the history of the universe, conventional physics breaks down so we have to content ourselves with what we think we know.
Cosmologists and astrophysicists tell us that in the initial phase of the big bang, within the first 10^-43 seconds after it started, the universe was about 10^-35 meters in diameter. This would have been the hottest it has ever been anywhere in the universe. This temperature can only be theorized, but the guessers are fairly well educated. It is believed to have been at least 10^30 degrees Kelvin. That is very hot.