Whilst the father is alive, the son can benefit from him by pleasing him, thus ensuring that he makes du’a for his son. After the father dies, then the son must repay some of the sacrifices the son made for him, and part of this can be done by sincerely praying for him after his death.
The Prophet, peace be upon him, said:
“When a person dies, all his actions are cut off except from three (matters): a sadaqah jariyah, or a pious son that prays for him, or some knowledge (that he gave) that others still benefit from.” (Recorded in Muslim)
Allah also commands us in the Qur’an:
“And lower the wings of humility and mercy, and say, ‘O My Lord! Have mercy on them, even as they took care of me while I was young.” (Surah al-Isra:24)
So the pious son should make a point of regularly praying for the deceased parents, for this is the least that he can do to repay them for their kindness and care. Likewise, the daughter too should prayer for her parents, as the hadith applies to both son and daughter.
This does not mean that a person should not pray for his parents if they are alive, for of course this too is one of the rights that the parents have over the child.