Graphene nanoribbons could potentially be used to create molecular wires with tailored conductance properties. However, understanding charge transport through a single molecule requires length-dependent conductance measurements and a systematic variation of the electrode potentials relative to the electronic states of the molecule. Here, we show that the conductance properties of a single molecule can be correlated with its electronic states. Using a scanning tunnelling microscope, the electronic structure of a long and narrow graphene nanoribbon, which is adsorbed on a Au(111) surface, is spatially mapped and its conductance then measured by lifting the molecule off the surface with the tip of the microscope. The tunnelling decay length is measured over a wide range of bias voltages, from the localized Tamm states over the gap up to the delocalized occupied and unoccupied electronic states of the nanoribbon. We also show how the conductance depends on the precise atomic structure and bending of the molecule in the junction, illustrating the importance of the edge states and a planar geometry.