The deployment of mobile edge computing services in LEO satellite networks achieves seamless coverage of computing services. However, the time-varying wireless channel conditions between satellite-terrestrial channels and the random arrival characteristics of ground users’ tasks bring new challenges for managing the LEO satellite’s communication and computing resources. Facing these challenges, a stochastic computation offloading problem of joint optimizing communication and computing resources allocation and computation offloading decisions is formulated for minimizing the long-term average total power cost of the ground users and the LEO satellite, with the constraint of long-term task queue stability. However, the computing resource allocation and the computation offloading decisions are coupled within different slots, thus making it challenging to address this problem. To this end, we first employ Lyapunov optimization to decouple the long-term stochastic computation offloading problem into the deterministic subproblem in each slot. Then, an online algorithm combining deep reinforcement learning and conventional optimization algorithms is proposed to solve these subproblems. Simulation results show that the proposed algorithm can achieve the superior performance while ensuring the stability of all task queues in LEO satellite networks.