Required sample size and power for SEM
MacCallum et al. (1996, 1997, 2006) and Kim (2005) propose methods to calculate the required sample size (given a desired power) or the achieved power (given a sample size) to assess the fit of structural equation models based upon different fit indices (e.g. RMSEA or AGFI). The code on this page implements these routines in R and SPSS.
Instructions: Choose the calculation of interest below, fill in the necessary information and press the download button. To run the code, copy and paste it in your R or SPSS syntax window on your computer.
Calculate required sample size

For RMSEA (1)

For RMSEA (2)

For GFI

For AGFI

For Steigers γ

For McDonalds MC

For test of no difference between nested models (RMSEA)

For test of small difference between nested models (RMSEA)
Calculate power

For RMSEA

For GFI

For AGFI

For test of no difference between nested models (RMSEA)

For test of small difference between nested models (RMSEA)
Note:
Apparently Preacher and Coffman (2006) have already published similar R routines a while ago. You can run their code online, without having to install R on your computer. Check it out.
Some of these routines are also provided in the semTools package in R.
Additionally Friendly (2000) wrote a SAS Macro to conduct these power estimations.
Literature
 Friendly, M. (2000, June).The csmpower macro  Power estimation for Covariance Structure Models [Computer software]. Available from http://www.math.yorku.ca/SCS/sasmac/csmpower.html (20080830).
 Kim, K. H. (2005). The Relation Among Fit Indexes, Power, and Sample Size in Structural Equation Modeling. Structural Equation Modeling, 12, 368390. doi: 10.1207/s15328007sem1203_2.
 MacCallum, R. C., Browne, M. W., & Cai, L. (2006). Testing differences between nested covariance structure models: Power analysis and null hypotheses. Psychological Methods, 11, 1935. doi: 10.1037/1082989X.11.1.19.
 MacCallum, R. C., Browne, M. W., & Sugawara, H. M. (1996). Power analysis and determination of sample size for covariance structure modeling. Psychological Methods, 1, 130149. doi: 10.1037/1082989X.1.2.130.
 MacCallum, R. C. & Hong, S. (1997). Power Analysis in Covariance Structure Modeling Using GFI and AGFI. Multivariate Behavioral Research, 32, 193210. doi: 10.1207/s15327906mbr3202_5 .
 Preacher, K. J. & Coffman, D. L. (2006, May). Computing power and minimum sample size for RMSEA [Computer software]. Available from http://www.quantpsy.org (20120313).