The prediction horizon is a key parameter in model predictive control (MPC), related to the effectiveness and stability of model predictive control. In vehicle control, the selection of prediction horizon is influenced by factors such as speed, path curvature, and target point density. To accommodate varying conditions such as road curvature and vehicle speed, we proposed a control strategy using the Proximal Policy Optimization (PPO) algorithm to adjust the prediction horizon, enabling MPC to achieve optimal performance, and called it PPO-MPC. In this paper, we constructed the vehicle dynamics model and designed a basic model prediction control. We have established a state space related to the path information and vehicle state, regarded the prediction horizon as actions, and designed a reward function to optimize the policy and value function. We conducted simulation verifications at various speeds and compared the MPC of the fixed Prediction Horizon. The simulation demonstrates that the PPO-MPC proposed in this article exhibits strong trajectory tracking capability.