A hole in the heart causes what is termed shunting of blood from one chamber to the other without going into system circulation and/or blood pumped to the lungs.
For some insight, the hole is in the septum (wall separating right and left side). It can be between the upper or lower chambers. When the pressure is higher on one side the pressure causes some blood to go into the opposite side chamber. Usually, it is a left to right shunt because left side normally has a higher pressure. That would cause oxygenated blood to go into a chamber that hasn't gone through the lungs...so the oxygenated blood is recycled again and usually no problem.
The problem that is more serious is a double shunting. The left side shunts blood as stated, and if the right side has an abnormally high pressure the unoxygenated blood is shunted into the left side and that causes contamination of oxygenated blood. The result can be hypoxia (low oxygen level in heart tissues) and treatment would be a outside source for oxygen.
I can't comment on proper treatment. Sometimes the hole can be closed without surgery. It is done with a cath threaded through the vessel to the heart.
Hope this helps, and if you have any further questions, you are welcome to respond. Take care.