(covers information from several alternate timelines)
"Photon torpedo: isn't that the universal greeting when communications are down?"
"I think it's the universal greeting when you don't like someone."
Photon torpedoes were warp-capable tactical matter/antimatter weapons commonly deployed aboard starships and starbases by various organizations. Photon torpedoes, often abbreviated as "photons", were called Pu'DaH dak cha in Klingonese. (TNG: "The Arsenal of Freedom", etc.; ENT: "Sleeping Dogs")
Klingons began using photon torpedoes by at least the mid-22nd century. They used them extensively on board Raptor-class scouts, D5 class battle cruisers, and Birds-of-Prey. In comparison, during the same period that Earth's Starfleet was still employing the spatial torpedo, although they soon upgraded to photonic torpedoes, the precursors to the photon torpedo. (ENT: "Fight or Flight", "Sleeping Dogs", "Judgment", "The Expanse", "Borderland")
The 24th century saw the deployment of an improved type of ordnance in the year 2371: the quantum torpedo. Nonetheless, photons continued to be utilized along with the new quantum torpedoes by such starships as the USS Enterprise-E. (DS9: "Defiant"; Star Trek Nemesis)
The components of a Federation photon torpedo were contained within an elongated elliptical casing, also known as a photon tube. The weapon was armed with a photon warhead. The warhead had a detonation chamber filled with antimatter. Upon detonation the torpedo created a matter-antimatter explosion and a flood of ion radiation. (Star Trek II: The Wrath of Khan, Star Trek III: The Search for Spock; DS9: "Tribunal"; VOY: "Good Shepherd"; TNG: "The Loss", "New Ground")
Torpedoes used by the Federation in 2365 could burrow through the surface of a planet intact. By 2367 the shields of a torpedo could protect it for several seconds, during which the torpedo entered a sun and burrowed into its stellar core. The torpedo flight engine was a sustainer engine that used reactants carried on board for power. Klingon and Federation photon torpedoes had a frequency, related to that of its target's deflector shield frequency modulation, measured in megahertz. When both were matched torpedoes could penetrate the shields of the target starship. (TNG: "Pen Pals", "Half a Life"; Star Trek Generations; VOY: "Equinox, Part II")
When fired by a Galaxy-class starship without shields at a target in close range, a single photon detonation had a high probability of destroying the firing ship as well. In 2365, the unshielded USS Lantree was destroyed with a single photon torpedo hit. The USS Enterprise-D stayed at a distance of forty kilometers. (TNG: "Q Who", "Unnatural Selection")
In 2367, if a torpedo was fired by a Galaxy-class starship with shields, at a target in close range, the torpedo explosion could cripple the firing ship. When shield strength was increased three hundred percent, the ship remained undamaged when a full spread of maximum yield torpedoes was detonated at close range. (TNG: "The Nth Degree")
In 2368, Federation photon torpedo warhead yields had at least 16 preset levels. A heavy enough explosion to disrupt a soliton wave was created with five torpedoes set to level 16. (TNG: "New Ground")
Federation photon torpedo types
Constitution-class starships carried an inventory of Mark VI torpedoes with terminium casings in 2285, and Mark VII photon torpedoes in 2293. At least the Mark VII torpedoes could not be programmed to fire themselves without a torpedo launcher. (Star Trek II: The Wrath of Khan; Star Trek III: The Search for Spock; Star Trek VI: The Undiscovered Country)
In 2370, Galaxy-class ships received a weapons upgrade that increased the explosive yield of photon torpedoes by eleven percent. Later that year, photon warheads used on Deep Space 9 were labeled as "Pho-torp Mark IV components". (TNG: "Genesis"; DS9: "Tribunal")
USS Voyager was equipped with type-6 photon torpedoes. They were not in use before Voyager was launched in 2371. Some of these torpedoes had a yield of 25 isotons. A class-6 warhead in this type of torpedo had the explosive yield of 200 isotons. These torpedoes had an effective range of approximately eight million kilometers. The class-6 torpedoes were not capable of creating tears into subspace. (VOY: "Dreadnought", "Scorpion, Part II", "Living Witness", "Human Error", "The Voyager Conspiracy")
The Voyager also carried class-9 and class-10 photon torpedoes. Qatai believed that the explosive charge of one class-9 torpedo could have destroyed the gigantic "telepathic pitcher plant" bioplasmic organism, if it was detonated deep within it's digestive track. (VOY: "Bliss") The class-10 torpedoes could be armed with even more powerful high yield warheads. (VOY: "Scorpion, Part II", "In the Flesh")
The computer screen of the class-9 torpedo interior was used by the impostors in 2376, to identify it as a standard issue torpedo of USS Voyager, classified as Mark XXV. (VOY: "Bliss", "Live Fast and Prosper")
In 2258, the USS Enterprise of the alternate reality carried smaller cylindrical photon torpedoes. Six could be simultaneously loaded in to a launcher. (Star Trek) A year later, the Enterprise was retrofitted with additional larger torpedo tubes along the secondary hull for prototype advanced long-range torpedoes. These torpedoes were designed to be undetectable to sensors. (Star Trek Into Darkness)
Other uses and modifications
- It has become something of a Starfleet tradition to place dead crewmembers inside an empty torpedo casing, and often such torpedoes are launched into space. The tradition is similar to the ancient Earth tradition of the burial at sea.
- Spock, Enrique Muñiz, Captain Lisa Cusak, and Jadzia Dax were placed in empty torpedo casings after their deaths. Spock's body was launched towards the rapidly-forming Genesis Planet. It is unknown, however, as to whether or not Cusak's or Jadzia Dax's body were launched into space, or if they were returned home for more traditional ceremonies. (Star Trek II: The Wrath of Khan; DS9: "The Ship", "The Sound of Her Voice", "Tears of the Prophets") Non-Starfleet personnel have also received this type of burial. Dr. Ira Graves' body was beamed into space in a tube with a transparent window to display his face. Lieutenant John Kelly's corpse, recovered from a graviton ellipse in 2376, was launched into space in a standard torpedo tube. (TNG: "The Schizoid Man"; VOY: "One Small Step")
- In 2259 in the alternate reality, Khan Noonien Singh retrofitted 72 advanced long-range torpedoes by removing a fuel container to make room inside the torpedo casing to smuggle his old crew from the SS Botany Bay who were stored inside cryotubes. (Star Trek Into Darkness)
- In 2293, Spock and McCoy modified a photon torpedo to follow the trail of ionized gas from Chang's Bird-of-Prey at Uhura's suggestion. This exposed the cloaked Bird-of-Prey and allowed its destruction by the USS Enterprise-A and the USS Excelsior. (Star Trek VI: The Undiscovered Country)
- A volley of Romulan photon torpedoes was credited for catalyzing a Kerr loop out of superstring material, that resulted in a symmetrical temporal rift, a wormhole without a definable center or event horizon, between 2344 and 2366. (TNG: "Yesterday's Enterprise")
- In 2368, Data used a "high-energy burst level 6" yield setting on the photon torpedo warheads to expose tachyon signatures with inertial displacement as a convoy of cloaked Romulan Warbirds. This setting presumably did not damage the Warbirds. (TNG: "Redemption")
- Torpedoes could also be deployed like mines. When released as mines, the torpedoes did not glow in any way. Armed torpedoes could be transported via the transporter to a specific location to detonate. (VOY: "Year of Hell", "Dark Frontier", "Child's Play")
- In 2364 Federation photon torpedoes had a display blast setting. A spread of torpedoes at this setting were detonated a kilometer from the surface of Ligon II as a warning burst to demonstrate the power of a Galaxy-class starship. (TNG: "Code of Honor")
- Photon torpedoes could be used for illumination. Torpedoes were used, by manually configuring them to emit luminous bursts with the initial dispersal of 6.9 kilometers, to illuminate dark matter particles in the Mar Oscura Nebula. (TNG: "In Theory") A torpedo was similarly modified to be a "warp flare", by reconfiguring it to emit a sustained polyluminous burst, for illumination in a region of space with a heavy concentration of theta radiation. (VOY: "Night")
- Doctor Timicin from Kaelon II made several modifications to the guidance system of Federation photon torpedoes that would enable him to implement his theory of helium fusion enhancement and possibly revitalize the Kaelon sun. (TNG: "Half a Life")
- Modifications to a photon torpedo could be made, so that a detonation inside a supernova remnant, like the MacPherson Nebula or a pulsar, like Dikon Alpha, would create a reaction that would artificially produce vertion particles. (TNG: "Emergence")
- A Federation class 8 probe used the same casing as a photon torpedo. It could be launched from a stationary platform at warp 9 and could travel at that velocity. (TNG: "Pen Pals", "The Emissary")
- Doctor Tolian Soran had several Starfleet torpedo casings labeled as Mark V and Mark IIB torpedoes, and smaller tube components labeled with Mark IIB, Mark IV, Mark VI, among his collection of solar probes in his secret torpedo bay aboard the Amargosa observatory in 2371. He modified one of the torpedoes to carry a trilithium weapon. (Star Trek Generations)
- When outfitted with a phase discriminator, the phase differential of the explosion of a photon torpedo could re-phased to be delivered into the variance of a different time continuum. (TNG: "Time's Arrow, Part II")
- When outfitted with a gravimetric charge, a photon torpedo could be turned into a gravimetric torpedo. Depending on the yield of the charge, several results could hypothetically be achieved, such as destroying a small planet, detonating a protostar to form a wormhole, or annihilating omega molecules. (VOY: "The Omega Directive")
- In 2374 and 2375 a number of standard and class-10 photon torpedoes of the USS Voyager were modified to be bio-molecular warheads. (VOY: "Scorpion, Part II", "In the Flesh")
- The catalytic agent used to recombine nucleonic particles in the atmosphere of a planet could be encased in photon torpedoes. A detonation of multiple torpedoes in the troposphere could be used to deliver the agents globally in the concussive forces of the blasts to create the isolytic reaction. In 2378, USS Voyager neutralized the antimatter radiation in Uxal's atmosphere using this method. (VOY: "Friendship One")
- When a ship without propulsion was on a decaying orbit around a planet, the shock wave of multiple photon torpedoes detonated at once less than a kilometer away could be used to gain altitude temporarily. Such a technique was used in 2151 to rescue the IKS Somraw from being crushed by the atmospheric pressure of a gas giant. (ENT: "Sleeping Dogs")
- Dispersal pattern
- Photon burst
- Photon charge
- Photonic shock wave
- Torpedo bay
- Torpedo launcher
- Torpedo tube
Establishing photon torpedoes
Photon torpedoes were introduced fairly late into the first season of Star Trek: The Original Series. They made their on-screen debut in the 19th episode of the series, "Arena". Before that, when the USS Enterprise fired shots that looked like globular bursts, they were identified in dialogue as proximity blasts from the phasers, as in "Balance of Terror". In fact, the early writer's guide, The Star Trek Guide, made no mention of the ship having photon torpedo armaments.  The sound of the proximity blasts (and subsequently the photon torpedoes) firing was that of the disintegration ray from the original The War of the Worlds.
The 1968 reference book The Making of Star Trek (page 194), gave this early description of the photon torpedo: "...photon torpedoes, which are energy pods of matter and anti-matter contained and held temporarily separated in a magno-photon force field. These can be used as torpedoes or depth charges, and can be set with electrochemical, proximity, and a variety of other fuses. Photon torpedoes can be fired directly at a target, laid out as a minefield, or scattered in an attacker's path as depth charges." However, the earlier 1967 episode "Obsession" seemed to contradict the whole notion that there was antimatter in these photon torpedoes. In the story, the Enterprise crew attempt to destroy the Dikironium cloud creature by exploding photon torpedoes inside it, when that had no effect, they turn to the most powerful weapon available at that time: an ounce of antimatter to produce a matter-antimatter blast to destroy the creature.
The idea that the photon torpedoes themselves had physical missile-like casing was never confirmed on screen during The Original Series. The idea of distinct "launchers" (or "tubes") for the torpedoes was first introduced in the second season episode, "The Changeling", as "torpedo number 2" was fired instead of just a "torpedo bank being discharged". Even as late as Star Trek: The Motion Picture, Andrew Probert did not envision the photon torpedo to be a capsule, as he says in his 2005 Trekplace interview: "I envisioned them as what we saw during the TV era, they were glowing globs of plasma or some sort of energy. They weren't giant capsules. I envision them as big, glowy, dangerous blobs of... scariness." 
Photon torpedoes were definitely weapons with physical missile casings by the time of the 1982 feature film Star Trek II: The Wrath of Khan. Furthermore, the special effect of a torpedo launched with a warhead and one launched as a coffin was completely different in the film. The first on-screen connection between photon torpedoes and antimatter came in 1989, in the second season episode "Samaritan Snare" of Star Trek: The Next Generation and it was not established until 1991, in the fourth season episode "Half a Life", that photon torpedoes had in fact deflector shields of their own.
While photon torpedoes made their first appearance in "Arena", set in the year 2267, the earliest on-screen use of photon torpedoes by a Starfleet vessel was depicted in the 2009 film, Star Trek, when the USS Kelvin defended itself from torpedoes fired by the Narada with phasers and a rapid-fire barrage of photon torpedoes, in a scene set in the year 2233. Kelvin's blue bolts were not identified in the dialogue of the film, but were identified in the script as photons.  It was also established in the 2002 episode "Sleeping Dogs" of Star Trek: Enterprise that the photon torpedo was in fact not an original Federation invention, but had in fact been used before by such races as the Klingons as far back as the 22nd century.
- Starfleet began developing two types of photon torpedoes starting in 2215, with the primary difficulty being the design of the warhead. The first type had the deuterium and antideuterium reactants driven together like in an implosion design nuclear weapon. This torpedo had a maximum range of 750,000 kilometers, as this was the stability limit of the containment field design. It had a low rate of annihilation, and was adequate as a defensive weapon only. The second type, which became operational in 2271 had the reactants mixed together in thousands of small magnetic packets. This increased the rate of annihilation. This type had an effective tactical range from fifteen kilometers to 3.5 million kilometers. (pg. 128, 130) These range figures are however inconsistent with the range of below 300,000 kilometers established in "The Wounded" for a torpedo type used in 2367.
- The second type warhead was loaded with a maximum yield of only 1.5 kilograms of antideuterium. Due to the premixed reactants, the released energy per unit time is greater than in a rupture of a storage pod containing 100 cubic meters of antideuterium. The torpedo had a dry mass of 247.5 kilograms. (pg. 129, 68 referenced) By using standard physics calculations, a payload of 1.5 kilograms equals to about 64.4 megatons. The second type, at maximum yield, generates the destructive effects greater than in an antimatter pod rupture. Antimatter is stored as liquid or slush on starships. (pg. 69) Density of mere liquid antideuterium is around 160 kilograms per cubic meter. According to this comparison the high annihilation rate energy release would be comparable to the effects in a 690 gigaton explosion. For the sake of plausibility the affected blast area at these intensities might be extremely small. Visual effects on-screen would seem to confirm this. Antimatter calculator: http://edwardmuller.com/calculator.htm
- As a safety measure the matter and antimatter are kept initially completely separated in the warhead. Only after the launch they are mixed during flight in the combiner tank, while still separated from each other in magnetic packets. This mixing takes a minimum of 1.02 seconds. (pg. 128, 129) This would explain why photon torpedoes are usually launched at very slow velocities when their targets are in relatively close range. As the travel time must always be over one second for the warhead to be ready to detonate.
- The propulsion system of the torpedoes is a warp sustainer engine. The engine coils of the torpedo grab and hold a hand-off field from the launcher tube's sequential field induction coils. A miniature matter/antimatter fuel cell adds power to the hand-off field. When launched in warp flight, torpedo will continue to travel at warp, when launched at sublight, torpedo will travel at a high sublight speed, but will not cross the warp threshold. (pg. 129)
- Class VIII medium-range and class IX long-range multi-mission warp probes both use a modified photon torpedo casing and a warp sustainer engine as the power plant. (pg. 117,118)
- Torpedoes will obtain a high sublight speed when launched from a stationary launch platform. They are still effective against close-in threat vessels. The fact that a class 8 probe was supposedly launched by a starbase at warp speeds in "The Emissary" might be inconsistent with the statement that photon torpedoes can't reach warp speed if launched from a stationary or a sublight platform.
- The Mark XXV torpedo was the current design as of 2375. It has a dry mass of only 186.7 kilograms. The reactant capacity has increased five percent over the previous design, leading to a slightly higher yield of 18.5 isotons. The reactants are in a cryogenic state. Effective tactical range was increased to 4.05 million kilometers. (pg. 84 and 94 referenced) This range would also be inconsistent with the eight million kilometer range figure given in "Human Error" of a torpedo type that had entered into service in 2371.
- The 25 isotons is the theoretical maximum yield limit for the standard photon torpedo first developed in 2268. This theoretical maximum was finally reached with the Mark IX warhead. (pg. 85) This yield level statement would contradict the 200 isoton figure from "Scorpion, Part II", not to mention the special high yield torpedo from that episode, that was supposedly even more powerful.
- The self-destruct packages aboard the USS Defiant are photon warheads. On Star Trek: Deep Space Nine, self-destruct is augmented with photon warheads scaled up 1.5 times of what is normally installed on torpedoes. The self-replicating mines had a photon warhead combiner tank as their explosive charge. (pg. 93, 94, 134)
- The explosive yield (of the type-6 torpedo) could be set to ten different levels. Level 1 was just a fireworks display, level 5 was the standard yield of one kilogram antimatter charge, and level 10 violated strategic arms limitation treaties.
- An Intrepid-class ship didn't carry the material to fabricate casings for these torpedoes, and needed planetary raw materials to make new ones. This statement would solve the inconsistency problem of the Voyager using over ninety torpedoes during the run of the series, while it was stated in the first season episode "The Cloud" that there was no way to replace the 38 torpedoes they had left at that time.
- The Beltesha Missile Systems Mark VI photon torpedo replaced the Morris Magtronics Model FP-4 torpedo during the Constitution-class refit in the 2270s. The Mark VI has four magnathrust propulsion units. (pg. 82, 85) The special effect of the original series photon torpedo is considerably different from the torpedoes seen from Star Trek: The Motion Picture onwards. This also suggests a change in the torpedo model.