Longevity, especially the longevity of the Buddha, comes up quite often. @ChrisW has cited the, probably apocryphal, story from the Mahāparinibbāna Sutta. It's very puzzling and unlikely way for the Buddha to behave, far too arbitrary. If he could live longer, then why not simply do it. Why set up harmless, lovable Ānanda to take the fall. I think this reflects early anxieties following the Buddha's death that things would not continue. However it is, I think, the first reference to the longevity of the Buddha in a Buddhist text.
Longevity is one of the classic payoffs from puñña or merit in the early Buddhist texts, i.e Appamāda Sutta SN 3.17:
Āyuṃ arogiyaṃ vaṇṇaṃ, saggaṃ uccākulīnataṃ;
Ratiyo patthayantena, uḷārā aparāparā
appamādaṃ pasaṃsanti, puññakiriyāsu paṇḍitā. (SN i.87)
Life, health, good looks, heaven, a good rebirth
Every wonderful thing one could wish,
The wise praise vigilance amongst all the merit making activities.
And the Buddha had acquired an essentially infinite amount of merit. So the question is why did he die at all? This question is actually asked by Ruchiraketu in the (Mahāyāna) Suvarṇaprabhāsottama Sūtra (chapter 2). In response he has a vision which a mandala of buddhas appear and answer his question.
mā tvaṃ kulaputraivaṃ cintaya evaṃ parīttaṃ bhagavataḥ śākyamunerāyuḥpramāṇam / tatkasya hetoḥ / na vayaṃ kulaputra taṃ samanupaśyāmaḥ sadevake loke samārake sabrahmake saśramaṇabrāhmaṇikāyāṃ prajāyāṃ sadevamānuṣāsurāyāṃ yaḥ samarthaḥ syādbhagavataḥ śākyamunestathāgatasyāyuḥpramāṇaparyantamadhigantuṃ yāvadaparāntakoṭibhiḥ sthāpayitvā tathāgatairarhadbhiḥ samyaksambuddhaiḥ / [9-10]
Don't you even think it, good man, that the lifespan of the Bhagavan Śākyamuṇi was limited. What is the reason? Good man, we do not see anyone in this world with it's devas, māras, brahmās, people who are ascetics & Brahmins, with kings, men and lords, who could understand, to the fullest possible extent, the lifespan of Śākyamuṇi Tathāgata, apart from the fully enlightened tathāgatas and arhats.
This is followed up by some verses including
jalārṇaveṣu sarveṣu śakyante bindubhir gaṇayitum /
na tu śākyamunerāyuḥ śakyaṃ gaṇayituṃ kvacit // Suv_2.1 //
The drops of water contained in all the oceans could be counted;
But no one can count the life of Śākyamuni
And so on. His apparent life and death are not to be taken seriously. His lifespan is infinite. BTW Sangharakshita covers this material in his talk: The Bodhisattva’s Dream. And also in his book on the Suvarṇa.
Any perceived short-comings on the part of the Buddha become increasingly problematic as time goes on. Apparent faults, such as a relatively short lifespan, are corrected by the invention of new myths and legends as time goes on. The principle reason for a bodhisatva to wish for a long life, is of course the same one that makes them put off awakening, so that they may help many beings.
In Tantra there are specific sādhana practices aimed at bestowing long life. These are often associated with Amitāyus (Whose name means "infinite life"), White Tārā, and Uṣṇiṣavijāya. Some of the relevant ceremonies are described in stephan Beyer's book Magic and Ritual in Tibet: The Cult of Tārā. A brief example is the well known White Tārā Mantra.
oṃ tāre tuttāre ture mama āyuḥ-puṇya-jñāna-puṣṭiṃ kuru svāhā
Although most elements of the mantra are untranslatable the section "mama āyuḥ-puṇya-jñāna-puṣṭiṃ kuru" is a Sanskrit sentence reading "Give me long-life, merit, knowledge and propersity". (BTW The Vulcan salute "life long and prosper might be "āyuḥ puṣṭiṃ bhavatu") One chants this mantra and hopes that White Tārā will bestow these qualities on one. The word "mama" can be substituted with the name of someone else we want to have these blessings.
So we can see that a concern with longevity is actually quite pervasive in Buddhism.