There is a common notion that those who die in Varanasi will get Mukthi. As a result, hundreds of Hindus are settling in Varanasi during their old ages. Where it is written in scriptures that those who die in Varnasi will get Mukthi?
In Skanda Purana it is written so. Must be there in Shiva Purana as well as in other Puranas too.
grhamedhyatra vishwesho bhavAnI tatkuTumbinI |
sarvebhyaH kAshisaMsthebhyo mokShabhikShAM prayacChati ||
`The divine couple residing in Kashi - Sri Vishwanatha and Sri Annapurna, grant the Bhiksha of Moksha to all residents of Kashi' - so say the scriptures. Thus, Kashi has been described as the foremost among the Mokshapuris. Kashi Khanda - which forms the fourth chapter of the Skanda Purana, describes the limitless glory of the sacred capital of Sri Vishwanatha
Kasi is the foremost among all the seven Mokshapuris.
Besides, I believe the following Sloka is also from the Skanda Purana.
Daarsanath Abra sadasi , jananath Kamalalaye ,
Kasyanthu maranath mukthi , Smaranath arunachale ||
Seeing Chidambaram, Being born in Thirivarur, Dying in Benares and just thinking of Thiruvannamalai would lead to salvation.
Lord Shiva says this to Lord Rama about importance of Manikarnika Ghat which is on the banks of River Ganga, Varanasi.
O Rama, we two are venerable to the world. You two (Sita and Rama) are always venerable to us. Gaurl mutters your name. I mutter your formula. To one desiring to die at Mani-karnika and remaining in half of its water I give your emancipating formula, giving (i.e. leading to) Brahman. [35-40]
Padma Purana Uttara Khanda Chapter 243
Reaching Brahman means moksha or mukti.
Shiva Purana also has information about this. From The Destroyer's answer about greatness of Kashi Vishwanatha Jyotiringa
अतस्तदेव जानीयात्प्रणव सर्वकारणम् । निर्विकारी मुमुक्षुर्मां निर्गुणं परमेश्वरम् ।। एनमेव हि देवेशि सर्वमन्त्रशि रोमणिम् । काश्यामहं प्रदास्यामि जीवानां मुक्तिहतवे ।।
Hence he who aspires for salvation and is free from aberration shall understand the Pranava as the cause of all, and Me as the Nirguna Parameshwara. I give this crest-jewel of mantras at Kashi for the liberation of all individual souls.
Kailsa Samhita Chapter 3