Van der Waals heterostructures offer an additional degree of freedom to tailor the electronic structure of two-dimensional materials, especially for the band-gap tuning that leads to various applications such as thermoelectric and optoelectronic conversions. In general, the electronic gap of a given system can be accurately predicted by using first-principles calculations, which is, however, restricted to a small unit cell. Here, we adopt a machine-learning algorithm to propose a physically intuitive descriptor by which the band gap of any heterostructures can be readily obtained, using group III, IV, and V elements as examples of the constituent atoms. The strong predictive power of our approach is demonstrated by high Pearson correlation coefficient for both the training (292 entries) and testing data (33 entries). By utilizing such a descriptor, which contains only four fundamental properties of the constituent atoms, we have rapidly predicted the gaps of 7140 possible heterostructures that agree well with first-principles results for randomly selected candidates.