Determining How Long Powerup Effects Should Last

A number of factors go into how long you want powerup effects to last, for example in my 2D/2.5D Space Shooter game I’m building I will have basic powerups like Triple Shot, Speed Boost , Shield, Health and some a bit more advanced like Homing weapons.
The homing weapons will deal more damage so it would make sense to limit their effect time to less than something like a triple shot.
A speed boosting powerup would be fine with 5–10 seconds.
You could also implement different difficulty levels in your game and make the powerup effects last for less time in the more difficult levels in addition to different or more enemies. Rarely spawning some powerup types like health and weapons that deal more damage will also increase difficulty.
It really just comes down to playtesting your game to see what seems right for each powerup type.