According to quantum mechanics, energy of a state is uncertain within a small range in hydrogen atom. But we also know that energy of a state is quantized which is contradictory to the first. Which one is correct?
The uncertainty refers only to states which stick around for a limited time. If you have a hydrogen atom form by capturing an electron, you have to wait a while before the H atom is in a sharply defined energy state. At early times, it is in a quantum superposition of all possible states. In order for a state to have definite energy, it must be undisturbed for a long time. But then the energy uncertainty goes to zero. The quantization is of this asymptotic long-time energy.
This topic is called the "time-energy uncertainty principle", and it has a long and inglorious history. The principle was the obvious time analog to the position-momentum uncertainty principle, and was appreciated as such by Bohr and Einstein. But the principle has some false formulations, like this one:
Landau said: "I can violate the time energy uncertainty principle by measuring the energy of a system very precisely, and then looking at my watch!" I think this is a very funny thing to say. It is a deep joke, because the time that a system is at is not a property of the system, but of Landau's watch. People sometimes tell this joke in a less droll way by saying "time is a parameter, not an observable", but this of course is in a particular formalism in which the parameter refers to watches, and the observables refer to system, and particle-time is matched to external proper time. But there are other formalisms in the world, some of which associate an internal ticking clock to the system.