when we bring a unit positive charge from infinity to a point in the electric field EF does work on the charge and external work is also done on the charge in same amount but in opposite sign. then how energy is gained by the charge at the point. I mean if both works done on charge are equal and opposite how energy is gained by the charge?
The definition of potential requires you to work out either the work done by an external force on the charge or the work done by the field but not both together.
If you consider both forces together you can use the work-energy theorem and say that as the net force on the charge is zero then the net work done on the charge is zero and hence the change in kinetic energy of the charge is zero.