I would check the upper and lower thermostat and make sure it's set right.
If the upper element had burned out, you would have no hot water at all.
The factory setting is pretty low, so try setting them higher. If the lower element has gone bad, you would have some hot water, like about half a tank. The top element goes on first, and when the upper half is heated, then the power switches to the lower thermostat and element.
If a new element is indeed needed, it won't be an issue of length, it will be installation method and wattage.
Bolt in or screw in.