I’m surprised no one has discussed this from a ‘Star Fleet Battles’ perspective. This is the board game/miniatures system designed to handle these very things.
Phasers are ideal as short to medium range weapons (all but the heaviest do no appreciable damage at distance).
They have some of the best accuracy of all weapon systems in universe.
They have a low energy usage so they can keep firing even after the ship and its power sources (engines and batteries) have been significantly damaged.
Their low energy usage and small general size allow for multiple phaser banks to run on a ship.
a. This gives the potential to have a larger effective firing arc (the Gorn where exceptional at building ships that where deadly from every angle)
b. and also means that multiple locations must be targeted by the enemy to disable the multiple locations where they are located.
They also have a relatively quick recharge/reload time.
a. This lets a few phasers to be fired without significantly reducing the Alpha Strike capability.
They can be used defensively.
a. Phasers are often used as anti missile weapons.
b. Phasers are ideal for taking out strike craft/shuttle craft/fighters and mines. (Some phaser banks [Phaser G’s if memory serves] where specifically designed for this role)
A well designed and maneuverable ship controlled by a deft captain and crew could let out a continuous fire of Phasers by rotating their ship and corkscrewing around their opponents path while constantly rotating the shields presented their foe.
Photon torpedoes are designed as long range weapons however they use a tone of energy.
They have one of the longest ranges in universe.
They are heavy hitting, dealing significant damage at any range.
They can be modified to fire even longer ranges as a proximity weapon. Decreased damage but it does increase accuracy and range)
They are not vulnerable to the anti missile fire of phasers (nor can they be tractored away from the target).
When they hit they frequently deal damage to multiple systems at once causing ship wide failures.
They serve as an extension to the ship in the numerous ways they can be modified for none combat use.
A well designed and fast ship could stay out of range of the enemy and let out a slow but steady barrage of photon torpedoes. Forcing the enemy ships to flee or be destroyed without dealing any return damage.
The Federation had a philosophy of multipurpose ships. So few ships where set up to focus on either activity, however this set up allowed nearly every ship to have options in any situation.
Alpha Strike
The alpha strike is the concept of charging all a ships weapons and then waiting until point blank range and unleashing them all at once or in quick succession. For a Federation ship to manage this full charge they often needed to reduce their maximum speed or run the risk of damaging their engines.
A well executed Alpha Strike could strip a shield sector by using all phasers, and then unload overloaded photon torpedoes (adjusted to increase damage but decrease accuracy) through that downed shield and destroy or cripple most ships of similar class.
Lead with photon torpedoes to take out almost all shields, and then unleash targeted phasers and you could cripple a ship with precision, cutting out warp drives or weapons, but keeping ship, crew and contents intact.
Power Usage
Everything ever ordered on the show takes energy. A ship does not have the energy to do everything at once. So these must be balanced based upon the tactical situation.
Speed: Faster speed means less power for other systems.
Raising Shields: Done at yellow alert
Reinforce Shields: Often seen in shows, this diverts extra energy to a specific section of the shields. You could sink all your energy into this. It makes that shield facing slightly stronger.
Deep Space Scans/Scanning Enemy Ships: Gets you extra information at the cost of energy.
Charging Weapons: Base charge. (between shields and speed the three biggest power sinks)
Specialty weapons: This is usually overcharging weapons for more range or power.
Charging Transporters: Land troops, extract personnel, or drop mines ect,
Preparing Shuttlecraft: Once launched they run on their own, but it takes energy to get them their.
Charging/Launching Probes: Can be used to scan the enemy or converted to deal extra weapon damage.
Warp Drive: Want to escape/run away? Even though the warp core supplies energy to the ship it still requires a certain amount of energy to get you out too.
Tractor Beam: Usefull in all sorts of military maneuvers.
Electronic Warefare: Used to increase your chance to hit, or to decrease the enemies chance to hit you, if you have the energy.
No ship in universe has the power to do everything at once. I hope this provides a useful guide to the specific tactical uses of both phasers and photon torpedoes.