Photonic crystal (PhC) cavities combine ultra-high quality (Q) factors with small mode volumes, resulting in an enhancement of the light-matter interaction at the nanoscale, which, beyond fundamental studies is advantageous for countless applications in photonics. In addition, III-nitride (III-N) semiconductors offer unique optical properties including a direct wide bandgap and tunable emission spanning the ultraviolet to near infrared (NIR) spectral region. Despite these advantages the development of III-N based PhC cavities has been hindered owing to several processing issues inherent to such hard and chemically inert materials. This work aims at investigating GaN-based PhC cavities operating at both visible and NIR frequencies. In the first part of this work a fabrication process that fulfills the low-defect requirements of PhCs, while remaining compatible with silicon for future integration prospects, was developed. It is based on the growth of GaN layers on Si(111) substrates, which are then patterned by e-beam lithography and dry etching techniques, including the substrate undercut in order to create an airgap below the PhC area, which guarantees light confinement into the resulting planar waveguide. This approach allowed achieving airgaps > 3 µm, which are essential for structures operating in the NIR, and hardly achievable by sacrificial layer techniques. The ultimate assessment of the optical quality of such nanostructures is given by the Q-factor of the cavity. In this regard, spectroscopic characterization of the fabricated samples was carried out. At visible wavelengths experimental Q-factors up to 5200 and 14000 have been ascertained in 2D PhC cavities and 1D nanobeam cavities, respectively, which represent the current state-of-the-art for both geometries at the time this dissertation was written. At IR frequencies the maximum Q which was measured amounts to 22500. Furthermore, it is important to estimate the fluctuations on both the Q-factor and the resonant wavelength of nominally identical replicas of the same cavity to account for the fabrication process reliability. This has been addressed by taking advantage of PhC cavities optimized by an effective genetic algorithm for Q-factor optimization (166000 at 1.3 µm in this case) [M.Minkov and V. Savona, Sci. Rep. 4, 5124 (2014)]. Thus, 20 groups of cavities were fabricated, to allow for lithographic tuning, that differ by 2 nm in the hole diameter from one group to another. Q-factor measurements were then carried out in a total of 60 cavities, namely 6 replicas of 10 different groups of cavities, demonstrating a high reproducibility and an average Q-factor ~17000. The second part of this thesis investigates the lasing characteristics of nanobeam cavities emitting in the violet-blue spectral range featuring a single InGaN quantum well (QW). In the high-absorption QW region lasing has been observed under continuous wave (cw) optical pumping at room temperature, demonstrating low threshold power densities ~740 W/cm2. The laser behavior was also analyzed by means of laser rate equations. The low cw lasing threshold is well accounted for by a large spontaneous emission coupling factor (>0.8), inherent to the nanobeam geometry. These results highlight the high potential of III-nitrides for the realization of nanophotonic devices and set a new step forward for the integration of wide bandgap semiconductors with silicon opening future prospects in biosensing and optogenetics.