Depends, some verses say that there's no heaven for sonless (unmarried) couples on the account of non-fulfillment of the Pitṛ Ṛṇa. There are remedies though, for that situation.
Again, like most things within Hinduism, there are varying beliefs.
I'm quoting some verses from smritis which say that even 'life-long' bachelors got/get heaven.
Vishnu Smriti 25.17
मृते भर्तरि साध्वी स्त्री ब्रह्मचर्ये व्यवस्थिता ।
स्वर्गं गच्छत्यपुत्रापि यथा ते ब्रह्मचारिणः ।। २५.१७ ।।
17. A good wife, who perseveres in a chaste life after the death of her lord, will go to heaven like (perpetual) students, even though she has no son.
Parāśara Smṛti 4.31
मृते भर्तरि या नारी ब्रह्मचर्यव्रते स्थिता ।
सा मृता लभते स्वर्गं यथा ते ब्रह्मचारिणः ।। ४.३१ ।।
- If on the death of her husband, a woman remains firm in her chastity, she obtains heaven, on death, in the manner of the 'Religious Students' (life-long observers of celibacy/sexual abstinence).
Āpastamba Praśna II, Paṭala 9, Khaṇḍa 23
अष्टाशीतिसहस्राणि ये प्रजामीषिर ऋषयः । दक्षिणेनार्यम्णः पन्थानं ते श्मशानानि भेजिरे ॥ ३ ॥
अष्टाशीतिसहस्राणि ये प्रजां नेषिर ऋषयः । उत्तरेणाऽयम्णः पन्थानं तेऽमृतत्वं हि कल्पते ॥ ४॥
इत्यूर्ध्वरेतसां प्रशंसा ॥५॥
‘Those eighty thousand sages who desired offspring passed to the South by Aryaman’s road and obtained cremation. Those eighty thousand sages who desired no offspring passed to the North by Aryaman’s road and obtained immortality. Thus are praised those who keep the vow of chastity.ξ’
ξ: However, in footnote 4 in Praśna II, Paṭala 9, Khaṇḍa 24, translator Georg Bühler remarks:
^4: Āpastamba's own opinion is apparently against pure asceticism.
And finally:
Manu Smṛti 5.157
अनेकानि सहस्राणि कुमारब्रह्मचारिणाम् ।
दिवं गतानि विप्राणामकृत्वा कुलसन्ततिम् ॥ १५७ ॥
If on the death of her husband, a woman remains firm in her chastity, she obtains heaven, on death, in the manner of the 'Religious Students' (life-long observers of celibacy/sexual abstinence).
Acharya Medhātithi in his commentary also concur:
Many thousands of unmarried students’—life-long celebates—‘have gone to heaven’—do go to heaven.
To conclude:
There are verses that say, that even without marriage, the door to Heavens (swarga-loka) isn't closed. Although 'the Householder's path' (gṛhasthāśrama), after studies are completed, is recommended for most people.
As Āpastamba himself notes in Praśna II, Paṭala 9, Khaṇḍa 21
चत्वार आश्रमा गार्हस्थ्य, माचार्यकुलं, मौनं, वानप्रस्थ्यमिति ॥१॥
तेषु सर्वेषु यथोपदेशमव्यग्रो वर्तमानः क्षेमं गच्छति ॥२॥
- If he lives in all these four (viz. the order of householders, the order of students, the order of ascetics, and the order of hermits in the woods), according to the rules (of the law), without allowing himself to be disturbed (by anything), he will obtain salvation.