In early Buddhism, there is more or less a linear progression of buddhas over time. So the next buddha to arise after Gautama Buddha will be Maitreya Buddha, in the distant future.
Otherwise, you may be thinking of the mythical account of the brahmin ascetic Sumedha, AKA Megha, who lived in the distant past and aspired to become a buddha. He received a prediction of future buddhahood from Dipamkara Buddha. He then became the bodhisattva, and after many lifetimes was reborn as Gautama, becoming our Buddha. That is the beginning of the story of the Buddha. Sumedha is usually depicted dressed as an ascetic with long matted hair (dreadlocks).
The story of Sumedha meeting Dipamkara Buddha and receiving the prediction of Bodhi is popularly referenced in the Vajracchedika Prajnaparamita Sutra (Diamond Sutra), which is a later Mahayana text. It refers to a few of the better-known Jatakas in illustrating some points. Namely, the one about Sumedha and Dipamkara, and the one about the bodhisattva as the sage Ksantivadin (who gets hacked limb from limb). Some early Mahayana sutras have occasional references to the Jatakas. The presumption was that listeners knew the stories about the past lives of the Buddha.
Early materials have few references to buddhas of the past. The oldest references to a list of past buddhas seems to be seven buddhas. They were then increased to over 20, and up from there… The largest number of buddhas of the past is held by the legendary biography of the Buddha, the Mahavastu, which refers to over 330 million buddhas of the past. Richard Salomon gave a talk about this topic with reference to the Gandharan Buddhist texts.
As for other people aspiring to become buddhas, but not in the same line as Gautama, Maitreya, etc., that comes in a few hundred years after the time of the Buddha. The Mahasamghika groups specifically held the tenet that there may be buddhas in the ten directions (i.e. four cardinal directions, zenith and nadir, and the four intermediary directions). In other words, other buddhas presiding over other buddha world-realms. This leads to the Mahayana cosmology that includes not only a vast timeline, but also a multiplicity of world systems.