Studies of charmonium properties and production mechanism started with the discovery of J/ψ meson. Since more than 40 years the charmonium production mechanism is still not entirely understood. Following the era of investigations at e⁺e⁻ machines, nowadays, charmonium states are copiously produced at hadron colliders, that allows systematic studies of their resonance parameters, production observables and decays. Despite large production rates, many charmonium states are barely studied due to the complications of their reconstruction against a large background level. The LHCb experiment provides a unique opportunity to study S-wave and P-wave charmonium states using their decays to hadrons. This allows measuring production observables of ηc and χc charmonium states. According to the theoretical formalism of Non-Relativistic QCD (NRQCD), the production observables of the same wave charmonium states are linked. Hence, the LHCb measurements provide a series of stringent tests of NRQCD. In the framework of this thesis, the first measurement of the ηc(1S) differential production cross-section at √s=13 TeV and the most precise to date single mass measurement are performed, where the ηc(1S)$ state is reconstructed via its decay to proton and antiproton. In addition, the production of the χc and ηc(2S) states in b-hadron decays is studied using decays to φφ. The obtained results are confronted with existing theory predictions. The original phenomenological analysis concludes that the description of charmonium prompt production and production in inclusive b-hadron decays in an entire range of transverse momentum remains a challenge.