Water from a hot water heater is not considered 'potable'. It should not be used for cooking or drinking.
The reason is this. The danger zone for most bacteria is 40 degrees F to 140 degrees F. There are several harmful bacteria that can live in your water heater, including legionella, if the temperature is maintained below 140 degrees F.
The danger increases with less frequent use of the heater, meaning that freshly treated water is not being introduced regularly to kill or knock down these bacterial populations.
The bacteria can be introduced several ways; when installing any new water line, breach in city main, native to well water, new water heater, etc.
Most plumber and health care professionals will recommend a temperature of 120 degrees F or less.
I prefer a high setting with a tempering valve serving the whole house, but this is not a 'cheap' solution, but is one of the safest.