Star Wars Power Generation
The Galactic Republic and Galactic Empire use a variety of power generators. The most powerful of these generators is the hypermatter reactor. Information on how these reactors work is scarce, but how much power they can produce is easier to calculate.
The most extreme example of a hypermatter reactor's power-generating capacity is the Death Star. A single shot from the Death Star's superlaser unleashes 1E38 Joules of energy; more than the Sun radiates in 8,000 years. The Death Star's hypermatter reactor is capable of recharging this weapon for another planet-destroying blast within a day, indicating that it can produce power on the order of 1E33 Watts, meaning it can produce more energy every second than the Sun radiates in a month.
Star Trek Power Generation
The United Federation of Planets and most other Star Trek civilizations use nuclear fusion and matter-antimatter annihilation to power their starships. The primary fusion power supply is the impulse engine, and the primary matter-antimatter reactor is the warp core.
The actual power produced by Federation power sources is unclear. Commander Riker once stated that the entire Enterprise could not generate a terawatt of power, but subsequent events have suggested greater power generation. The ship's warp core is known to have undergone some modifications and upgrades following Riker's statement, and the chief engineer subsequently said it could generate power "into the terawatt range".
At the other extreme, Commander Data once said the ship's reactor was generating "12.75 billion gigawatts per (second)". This is a nonsensical statement, since watts per second is not a unit of power. The word "second" was actually cut off by an alarm in the episode, but it does appear in the script, so we have a reasonable idea of what Data's next word would have been. To add to the inaccuracy, Data was responding to a statement about the amount of energy in the warp core, which should be in either joules or watts multiplied by time, not watts divided by anything.
Despite the officers' statements, a plan to use the ship to stabilize the orbit of a small moon suggests considerably more than one terawatt of power generation, but far less than 12.75 million terawatts. Although it was never successfully completed (and the need to do so was eventually removed by Q), the proposed plan -- which would change the velocity of a 6E13 kg mass by 4 km/s within 7 hours -- would require approximately 21,000 TW of power to work. Attempting to move this moon pushed the Enterprise to its limits, but it would have been a trivial task if the ship could have applied even a small fraction of 12.75 billion gigawatts to the task.
Trekkie Counter-arguments Regarding "Deja Q"
Trekkies argue that the Bre'el moon in "Deja Q" was much more massive than 6E13 kg, based on screen shots of the Enterprise-D in very close proximity to the asteroidal moon. They also attempt to estimate the mass of the moon from tidal effects on the planet Bre'el IV.
According to the tidal argument, tidal force is the difference in gravitational force between the edges and center of mass of an large mass, which can be found using the formula Gm/R^2-Gm/(R+/-r)^2.
Using this argument, they generate a mass for the moon in the E16 kg range (~4E16 kg) as a first-order estimate, bearing in mind for assumptions and typical variables with 10^(16.5+/-1.5) kg based on the tidal effects alone for a lower-end estimate. This would place the Bre'el moon in the same mass and size category as Mars' asteroidal moons Phobos and Deimos (20-30 km).
To change the velocity of a 1E16 KG mass by 92 m/sec requires 4.23E19 J. Since it took ten seconds during the first attempt to apply that delta-V, approximately 4.2E18 watts. Comparable to, though substantially lower than Data's 12.75 billion gigawatt quote from "True Q".