Timo said:
The tech advisors helped out the writers a lot here, postulating a variable yield for the torpedoes. This was an observed fact for basically the entire history of photon torpedoes in Trek, and was made retroactively canonical in ENT when photonic torpedoes were introduced in the third season (that is, the mid-2150s) and explicitly said to have a highly variable yield.
In terms of real-world timeline, the idea was solidified earlier on already: tech books began to speak of variable yield in the eighties with the rebirth of Trek in the form of TNG and the TOS movies. The first canon reference to variability might be in TNG "Redemption" where Data orders "love pat" torpedoes fired to expose the cloaked Romulan ships.
So the real question here is probably "How much is the highest possible yield that a starship's shields have to defend against in a characteristic Trek space battle?". It might be that the highest technically possible yields are never used in actual ship-to-ship combat; perhaps multiple medium-yield torpedoes are the preferred way. Or then a succession of yields, so that at first a volley of low-yielders would hurt the enemy and make him an easier target for the more expensive medium-yielders...
I guess the point is, we don't know the upper limit of photon torpedo or quantum torpedo yield for an onscreen fact, but thanks to the tech advisors, we are at liberty to choose as high or low a value as we please. Further, we are also at liberty to choose how much of that the shields of a starship need to repel in a typical battle.
To be sure, some books, mainly the TNG and DS9 Tech Manuals, suggest a maximum of 3-5 kg of matter being converted to energy per photon torpedo, meaning hundred-megaton blasts at best (not really enough to do the "atmosphere-ripping" effect from TOS "Obsession" as mentioned above, even assuming a very small planet). Whether such blasts would have the same effect against shields as hundred-megaton nukes would is unknown; the mechanisms involved might be quite different, as the spectra of radiation released would differ a bit.
Timo Saloniemi