Praise be to Allah., the Lord of the Worlds, and blessings be upon our Prophet Muhammad and all his family and companions.
The Muslim has to perform the prayers at the appointed times and it is not permissible to delay them for no reason, because Allaah says (interpretation of the meaning):
“Verily, Al-Salaat (the prayer) is enjoined on the believers at fixed hours” [al-Nisaa’ 4:103], i.e. it is obligatory at specific times, and should not be brought forward or delayed. The timing is the most important condition of prayer: if a person is not able to fulfil some of the conditions of the prayer, he should still pray as best as he can, within the prescribed time, and he should not delay it. One of the things that indicate the importance of the times of prayer in sharee’ah is the fact that if a Muslim cannot find water, he should do tayammum (“dry ablution” using earth or sand) and pray, even if he is sure that he will find water after the time for that prayer has passed.
The fact that a child walks in front of his mother whilst she is praying does not have any effect on the prayer and does not make it invalid. It was reported that the Prophet (peace and blessings of Allaah be upon him) carried a small girl whilst he was praying, picking her up when he stood up and putting her down when he prostrated (sujood). This was reported by al-Bukhaari and Muslim from Abu Qutaadah al-Ansaari: “The Messenger of Allaah (peace and blessings of Allaah be upon him) used to pray whilst he was carrying Umaamah, the daughter of Zaynab bint Rasool-Allaah (peace and blessings of Allaah be upon him). According to the report of Abu’l-‘Aas ibn Rabee’ah ibn ‘Abd Shams, when he prostrated he put her down, and when he stood up he picked her up.”(Narrated by al-Bukhaari, no. 486, and Muslim, no. 844).
It was also reported that he (peace and blessings of Allaah be upon him) allowed a small boy to ride on his shoulders and he still completed the prayer. This was reported by ‘Abd-Allaah ibn Shaddaad from his father: “The Messenger of Allaah (peace and blessings of Allaah be upon him) came out to lead us in either Maghrib or ‘Ishaa’ one night, and he was carrying Hasan or Husayn. The Messenger of Allaah (peace and blessings of Allaah be upon him) came forward and put (the child) down, then he said Takbeer and started to pray. During the prayer, he prostrated and made his prostration long. My father said: ‘I raised my head and I saw the child on the back of the Messenger of Allaah (peace and blessings of Allaah be upon him) whilst he was prostrating, so I returned to my prostration.’ When the Messenger of Allaah (peace and blessings of Allaah be upon him) finished praying, the people said, ‘O Messenger of Allaah, during your prayer you prostrated for so long that we thought something had happened or that you were receiving Revelation.’ He said, ‘Nothing at all happened, but my son was riding on my back and I did not want to disturb him until he had had enough.’”(Narrated by al-Nisaa’i, no. 1192; classed as saheeh by al-Albaani – may Allaah have mercy on him – in Saheeh Sunan al-Nisaa’i, 1/246).
If you pick you child up and put him down whilst you are praying, it will not do any harm. Keep offering your prayers at the appointed times. May Allaah help us and you to do all that is good.