Seven Generations

One of the distinguishing characteristics of this most great Dispensation is that the kin of such as have recognized and embraced the truth of this Revelation and have, in the glory of His name, the Sovereign Lord, quaffed the choice, sealed wine from the chalice of the love of the one true God, will, upon their death, if they are outwardly non-believers, be graciously invested with divine forgiveness and partake of the ocean of His Mercy. This bounty, however, will be vouchsafed only to such souls as have inflicted no harm upon Him Who is the Sovereign Truth nor upon His loved ones. Thus hath it been ordained by Him Who is the Lord of the Throne on High and the Ruler of this world and of the world to come.

Bahá’u’lláh, The Compilation of Compilations vol. I, p. 386

We cannot take the teaching that if a believer remains steadfast till the end of his life he will be the means of spiritual awakening of all his ancestors too literally, especially as it is only reported, and not in an authenticated form. However, we can be assured that the true and faithful believer will be in a much better position to intercede for his ancestors, and aid in their development than if he were not spiritually enlightened.

Shoghi Effendi, Lights of Guidance, p. 228

In reference to your question about ancestors and descendants, we have been directed to say that while there are Tablets from Bahá’u’lláh stating that faith in the Manifestation of God on the part of a believer attracts God's Mercy to the souls of departed parents the House of Justice knows of no text in Bahá’í Writings to support the statement that a believer's seven past generations and seven generations to descend from him are blessed when that person becomes a Bahá’í. You may also be familiar with the statement of ‘Abdu’l-Bahá that 'it is permitted to ask for advancement, forgiveness, mercy, beneficence, and blessings for a man after his death...Therefore children...must implore pardon and forgiveness for their parents'."

Universal House of Justice, Lights of Guidance, p. 227-228