It is stationary when the variance, covariance and mean of the series are constant with time.
Here is a visual example:
A time series is stationary if it doesn't have a time-dependent mean, time-dependent variance and time dependent covariance. The first image we can see that there is a trend upwards, which indicates a time-dependent mean. In the second image we can see how the variance of the signal changes over time indicating a time-dependent variance. In the final image we can also see how the covariance changes over time indicating a time-dependent covariance.
A time series whose statistical properties change over time is called a non-stationary time series. Thus a time series with a trend or seasonality is non-stationary in nature. This is because the presence of trend or seasonality will affect the mean, variance and other properties at any given point in time.
(g) Annual total of lynx trapped in the McKenzie River district of north-west Canada; (h) Monthly Australian beer production; (i) Monthly Australian electricity production.
At first glance, the strong cycles in series (g) might appear to make it non-stationary. But these cycles are aperiodic — they are caused when the lynx population becomes too large for the available feed, so that they stop breeding and the population falls to low numbers, then the regeneration of their food sources allows the population to grow again, and so on. In the long-term, the timing of these cycles is not predictable. Hence the series is stationary. However, obvious seasonality rules out series (h) and (i) from being stationary.
We can use the Augmented Dickey-Fuller test to check if the time series has a unit root. If the p-value is > 0.05 we fail to reject the null hypothesis, the data has a unit root and is non-stationary. If the p-value is <= 0.05 we reject the null hypothesis, the data does not have a unit root and is stationary. A unit root is a random time series with drift.