In both cases, the water takes in the energy. It is not exactly the same amount of energy for evaporation and boiling, but it's similar.
Energy is conserved. This means that the energy that goes into a system is equal to the change in energy of a system. In this case, we plan to make all energy transfers as heat (and none as work), so we can write the equation
$$Q = E_f - E_i.$$
$Q$ is the heat that enters a system. $E_f$ is its final energy. $E_i$ is its initial energy.
First let's consider boiling $1 \;\mathrm{g}$ of water from room temperature until it's completely boiled away. The initial state is has some thermal energy, $E_{\mathrm{liquid};0}$, for $1 \;\mathrm{g}$ of liquid water at room temperature. The final state has thermal energy $E_{\mathrm{vapor};b}$ for $1 \;\mathrm{g}$ of water vapor at the boiling point. So the heat input is
$$Q_{\mathrm{boil}} = E_{\mathrm{vapor};b} - E_{\mathrm{liquid},0}.$$
Next let's consider evaporating $1 \;\mathrm{g}$ of room temperature liquid water completely into water vapor. In this process, we can assume that the air temperature remains the same, and that the water vapor is in thermal equilibrium with the air. So the initial state is the same, but the final state is water vapor at room temperature, not water vapor at the boiling point. So the heat input is
$$Q_{\mathrm{evaporate}} = E_{\mathrm{vapor},0} - E_{\mathrm{liquid},0}.$$
The heat input is not the same in the two cases. It takes less heat to evaporate water than to boil it because the final state is lower energy. (Water vapor at a lower temperature has less energy.) However, the energy needed to evaporate the water is still significant, and comparable in magnitude to the energy needed to boil the water. This is because the energy needed to heat the water vapor is relatively small compared to the heat of vaporization, which is energy needed to break the hydrogen bonds between the water molecules.
During boiling, the heat will have to be supplied by some external source in order to heat up the water. During evaporation, the heat can come simply from the surroundings, e.g. from the remaining water, from the air, etc. The result is that when the water evaporates, the surroundings cool. This is the mechanism behind sweat cooling you. You sweat, the sweat evaporates, taking heat away from the remaining sweat and from your body, and you feel cooler. Another, more dramatic consequence is that a puddle of water can freeze when the air temperature is above freezing, if the air is dry. In that case, some water can evaporate into the air, cooling the remaining water until it freezes. For a given air temperature and humidity, water can be cooled in this way down approximately to the wet bulb temperature.