This paper investigates the end-to-end human-Mars entry, powered-descent, and landing (EDL) guidance problem by developing an on-board learning-based optimal control method (L-OCM) to achieve the goal of precise and fuel-efficient planetary landing. First, the end-to-end EDL guidance problem is formulated as a multi-phase optimal control problem with hybrid dynamics and constraints. Then a customized alternating direction method of multipliers is applied to solve the end-to-end EDL guidance problem with varying initial states off-line. After that, the L-OCM is developed to generate real-time optimal guidance commands. To be specific, supported by the optimal control theory, the necessary conditions of optimality for optimal control of the entry phase and powered-descent phase are derived, respectively, which leads to two two-point-boundary-value-problems (TPBVPs). Then, critical parameters are identified to approximate the complete solutions of the TPBVPs. To find the implicit relationship between the initial states and these critical parameters, deep neural networks are constructed to learn the values of these critical parameters in real-time with training data obtained from the off-line solutions. Furthermore, when random disturbances are considered during the EDL process, the single stage L-OCM is extended to the multi-stage L-OCM to regenerate real-time optimal guidance commands. Finally, the proposed L-OCM is implemented in extensive simulation cases to verify the effectiveness and efficiency of the new method.