The symptoms you describe are consistent with a failed lower element.
An electric water heater typically has two elements (and two thermostats). Only one element operates at a time.
Under normal operating conditions, the lower element will turn on when water is drawn out of the top of the tank and cold water enters the bottom of the tank. When this water at the bottom of the tank is sufficiently heated, the lower element turns off. The upper element is not activated at all.
If a large quantity of water is drawn, perhaps in excess of 50% of the tank capacity, the upper thermostat will detect cooling in the upper portion of the tank. This will cause the upper element to turn on and the lower element to turn off. When the upper element heats the upper part of the tank sufficiently, it switches back to the lower element to complete the heating cycle.
If the lower element or thermostat fails, the lower portion of the tank will never be heated. This significantly reduces the effective capacity, as only the upper portion of the tank will be heated.
If the upper element fails, you may continue to get hot water as long as the upper thermostat is not triggered. But once the upper portion of the tank cools and the thermostat triggers the upper element to come on, all heating ceases. The lower element will never come back on (because the upper thermostat is calling for heat from the upper element, which fails to provide.)
Another less-common possibility is a broken dip tube on the cold water inlet. Normally, the cold water inlet is at the top of the tank and just inside this inlet, there is a tube that extends to the bottom of the tank to direct incoming cold water to the bottom. If the dip tube has broken, cold water now enters the top of the tank, where it mixes with hot water and cools it off.
Before replacing the element, check the sacrificial anode. This is an aluminum or magnesium rod about 3/4" diameter with a steel wire core. It helps prevent corrosion of the water tank. If the rod is more than 50% consumed replace it along with the element. If it is completely consumed so that only the wire core remains, replace the entire water heater.
(If a sacrificial anode is allowed to be completely consumed, we can assume that the tank has begun to corrode and will need to be replaced soon. Better to replace the tank before it leaks than have to clean up water damage from a flood!)