This will not be that easy to find. There are many things that can be causing this and you will need to try each thing to see if it does the trick. I will give you a few things to try, but there may be some items that I miss, simply because I cannot see the entire setup. Air can get into a plumbing system in any number of ways: a water main break, a repair process in your own home, dissolved air within water, etc.
You may need to replace the anode rod, since they have been known to add air into the water.
You may need to verify that the well is working properly, since the pump and/ or pressure tank could be allowing air into the system. You could have air in the cold pipes as well; it is just not as noticeable, since heated water expands and can release the air much easier. To test this, you could fill a cup with cold water and see if there are any water bubbles; if there are this would be a sign that the air is entering from the well pump or somewhere else in the system, prior to the heater. The heater is just exaggerating the air in the water, as I discussed earlier.
Another possibility, if this is an electric hot water heater, is that the high wattage elements could possibly be electrolyzing the water into hydrogen/ oxygen. If you can separate the water heater from the concrete floor with a piece of plywood or something similar, you can help to electrically insulate the heater from the concrete floor. Electricity could be leaking somewhere to ground, causing current to pass through the water and electrolyzing the water.
If you need further help or clarification on this answer, please do not hesitate to reply to this post.
Thanks for asking your question at Just Answer.
Best of Luck, Brian
Please leave feedback at your convenience.