This study investigates the dependence and risk spillovers in the short-, medium- and long-terms between natural gas (NG), crude oil and stock markets of top energy producer countries (Russia, Ukraine, and US) and consumer countries (China, India, and EU members). Using the wavelet coherence approach, the results show a long-term dependence between NG and all stock markets between 2006 and 2022. Low and intermediate frequency co-movements of oil with stock markets are more pronounced among top energy producers than top energy consumers (except the EU). Further, there is heterogeneous dependence between stock markets and both NG and oil. Moreover, the dependence is positive and high for oil, and negative for NG, irrespective of the time horizon. NG is a hedge asset in the short-, medium- and long-terms for investors in top energy producer and consumer countries. Oil is a diversifier asset in the long term and a weak hedge asset in both short- and long-terms. We find evidence of significant bidirectional and asymmetric spillovers of NG, oil, and stock markets. The upside and downside risk spillovers for both NG and oil are higher in the long term than in the short- and medium-terms. NG sends more risk to stock markets than oil does in the long term, particularly in Russia. Our findings have significant implications for financial risk assessments and stock market stability.