My Biochemistry book states the First law of Thermodynamics like this: "The First Law of Thermodynamics states that in a closed system, energy is conserved". My book defines Closed System as a system which can exchange energy with its surroundings but not matter. My doubt is how can energy be remain conserved(constant) if the system can exchange energy with its surroundings. Please clarify.
You can think of the first law of thermodynamics as an energy accounting method. It says that all inputs and outputs of energy should add up to the total change in the energy of a system. The exchanged energy is generally classified as work or heat. By "energy can neither be created nor destroyed," it is meant that nuclear reactions, in which the structure of nuclei changes with accompanying transformation of matter into energy and vice-versa, will not be considered. The reactions considered are ordinary chemical reactions involving making and breaking of chemical bonds resulting from interactions between electrons and nuclei.
Your book is misleading. It should have stated "An isolated system", but probably for the sake of convenience, mentioned "closed", ignoring the fact that closed has a completely different terminology.
As an isolated system can exchange neither energy nor matter, there is no form of energy entering or exiting it.
Thus the correct statement would be that "The total energy in an isolated system remains constant".