How long does it take for holes in the heart to mend for a baby after birth?

Depends. Depends on the "hole" he has. There are different types of defects, some will never close themselves, and some might partially or fully close, but, again, it depends on the type of defect.
Depends on situation. Some forms of ventricular septal defect will close in the first six months or so in a baby, depending on size & location but some will not. Holes between the upper chamber seem less likely to close without help. Most physicians will monitor the situation & delay assisted closure until the child is older or the child develops problems related to the defect.