The main source rocks, hydrocarbon generative subbasins, hydrocarbon generation periods, resource potential, and the relationship between the trap evolution history and hydrocarbon generation history are important problems associated with oil and gas exploration. In this study, we develop a three-dimensional geological model with respect to the Mesozoic and Cenozoic strata of the northern margin of the Qaidam Basin based on the most recent geological data. Using this model, the burial depth, temperature, maturity, and gas generation history of the source rock, the plane diagram of the source-rock current maturity, the gas generation intensity map, and the amount of gas generation during each geological period and within different subbasins can be obtained. Based on the obtained maps, we can state that the maturity of the source rock controls the distribution of natural gas (i.e., natural gas is located within and in the vicinity of mature and highly mature source rocks). We also observed the following: (1) the Lower Jurassic section is the main gas source rock; (2) the Yibei subbasin is the main hydrocarbon generative subbasin, followed by the Kunteyi, Pingdong, and Lenghu subbasins; (3) the main gas generation period is after the upper member of the lower Ganchaigou Formation deposition, with maximum gas generation occurring during the upper Ganchaigou Formation deposition and gradually decreasing thereafter—the majority of the structures in the inner basin are formed after lower Youshashan Formation deposition, demonstrating the tectonic activity coincided with periods of natural gas formation; and (4) the amount of natural gas resource becomes 1.23 trillion cubic meters. From these analyses, we can demonstrate that the late tectonic belts formed in the four gas-generating subbasins exhibit considerable promise for exploration.