Previous studies of gravitationally bound states of ultracold neutrons showed the quantization of energy levels, and confirmed quantum mechanical predictions for the average size of the two lowest energy states wave functions. Improvements in position-like measurements can increase the accuracy by an order of magnitude only. We therefore develop another approach, consisting in accurate measurements of the energy levels. The GRANIT experiment is devoted to the study of resonant transitions between quantum states induced by an oscillating perturbation. According to Heisenbergs uncertainty relations, the accuracy of measurement of the energy levels is limited by the time available to perform the transitions. Thus, trapping quantum states will be necessary, and each source of losses has to be controlled in order to maximize the lifetime of the states. We discuss the general principles of transitions between quantum states, and consider the main systematical losses of neutrons in a trap.