This paper presents a technique for determining the optimal number of elements in stochastic finite element analysis based on reliability analysis. Using the change-of-variable perturbation stochastic finite element approach, the probability density function of the dynamic responses of stochastic structures is explicitly determined. This method combines the perturbation stochastic finite element method with the change-of-variable technique into a united model. To further examine the relationships between the random fields, discretization of the random field parameters, such as the variance function and the scale of fluctuation, is also performed. Accordingly, the reliability index is calculated based on the explicit probability density function of responses with Gaussian or non-Gaussian random fields in any number of elements corresponding to the random field discretization. The numerical examples illustrate the effectiveness of the proposed method for a one-dimensional cantilever reinforced concrete column and a two-dimensional steel plate shear wall. The benefit of this method is that the probability density function of responses can be obtained explicitly without the use simulation techniques. Any type of random variable with any statistical distribution can be incorporated into the calculations, regardless of the restrictions imposed by the type of statistical distribution of random variables. Consequently, this method can be utilized as a suitable guideline for the efficient implementation of stochastic finite element analysis of structures, regardless of the statistical distribution of random variables.