If the result is not statistically significant, there are two possibilities. One is that the null hypothesis is true. The other is that the null hypothesis is false (so there really is a difference between the populations) but some combination of small sample size, large scatter and bad luck led your experiment to a conclusion that the result is not statistically significant.
Running a power analysis can help understand the results. A power calculation answers this question:
If the true difference between populations is a stated hypothetical value (a value you would find large enough to be worth detecting), what is the chance that a study of the size you just did (given the scatter you observed) would conclude that the difference is statistically significant?
Interpreting the results:
- If the power to detect the difference you would have cared about is high, then your results are pretty good evidence that the actual difference is likely to be smaller than your hypothetical value. You have solid negative data.
- If the power to detect that difference is low, then you really can't conclude much from your data. Your findings are equivocal.
Hopefully, the explanation above shows how a power analysis can be helpful in interpreting a not-statistically-significant result. In contrast, power analyses don't help much when the result is statistically significant.
Important note: The power analysis should be set to compute the power to detect the smallest difference that you would find scientifically (or clinically) worth detecting. It is not even a tiny bit helpful to run a power analysis set to compute the power to detect the difference that your study actually detected. Such post-hoc or observed power calculations are invalid if they are based on the effect actually observed.
2019 UPDATE. While I think everything above is true, I am not sure it is so helpful. Much better to compute and interpret the 95% confidence interval for the difference (or ratio) and not even think about power. Power really is a way to quantify the effectiveness of a proposed experiment and not a good way to quantify or understand the results of a completed experiment...