Edge computing is regarded as the new paradigm to provide cloud computing capacity for edge users. Meanwhile, more and more edge devices are connected to edge servers. The end devices choose to offload their computation task to the edge server for reducing computation load and improving task process efficiency. However, due to the limited communication capacity of the edge base station, the edge server needs to reasonably assign bandwidth resources to improve the quality of service (QoS). In this paper, we focus on the offloading problem of the partial computation task. The objective is to reduce the task computation time by reasonably allocating the bandwidth resource and making a moderate task offloading proportion. Firstly, the optimization problems for users and edge servers are successively discussed. Then, the game theory is adopted and the Stackelberg game model is built. Furthermore, the existence of the Nash equilibrium is proven. Meanwhile, the computation algorithm is designed. Finally, the numerical simulation is conducted to evaluate the performance of the proposed algorithm. The results imply that the performance of the proposed algorithm is better than that of the benchmark algorithms in terms of the task computation time and energy consumption.