Powerups last a number of shots - there is no timer. The number of shots you have left (and the powers you have) persist even through death. Regular shots and "charged" shots (right click) both count as one shot.
Picking up any powerup except "Fast Shot" gives you three shots. Picking up any powerup afterward (besides "Fast Shot") resets the counter to three shots, and you keep any powers you already had (so if you had "Power Shot", shot twice, and picked up "Freeze Shot", you would have 3 shots that had both the "Power" and "Freeze" effects).
"Fast Shot" is a little finicky. It gives you nine shots instead of three, and if you keep picking up only "Fast Shot" powerups, it resets to nine. However, picking up other powerups in addition to "Fast Shot" gives odd shot counts (I've seen nine, seven, six, eight...). It probably has to do with how the counter gets reset on pickup.