Carbon nanotubes (CNTs) are widely employed to modern engineering applications. The structural beam element is an acceptable model that has been used to simulate the CNTs' response. At the same time the gradient elasticity theory, taking into account the size effect phenomena, can be considered a viable option to study the mechanical response of CNTs through a generalized gradient beam model. Given that the constitutive equations of this theory produce a boundary layer, the hp-version interior penalty discontinuous Galerkin finite element methods (IPDGFEMs) are developed in this work for the solution of a static, tensile or compressive, gradient elastic beam in macro- and micro-structure (CNT), respectively. An a priori error analysis of the aforementioned methods is performed and numerical simulations that verify the analytical findings are carried out. The consistency, the stability and the convergence of the IPDGFEMs are proved. A priori error estimates established also indicate an optimal convergence in the meshsize h, yet a slightly suboptimal convergence in the polynomial degree p.