We investigate the distribution of charges injected into one-dimensional nanostructures like semiconductor nanowires and carbon nanotubes. The charges are injected by an atomic force microscope tip and monitored by means of electrostatic force microscopy. We demonstrate that the charges distribute rapidly along the axes of both types of nanostructures. The charges deposited on nanowires are shown to migrate to the substrate on a shorter time scale than those deposited on nanotubes, while the holes migrate even slower than the electrons. This behaviour is attributed to the amount and type of available trap states in the respective nanostructure.