We extend our previous one-dimensional Ginzburg-Landau calculations of the pinning energy of vortices to two dimensions, in order to achieve an understanding of the pinning forces exerted on vortices by defects. By minimizing the free energy using a relaxation scheme, we obtain the spatial variation of the order parameter and supercurrents for a vortex in the vicinity of a cylindrical defect in an extreme type-II superconductor. The resulting two-dimensional field distributions provide a direct mapping of the spatial dependence of the vortex-defect pinning potential, thereby yielding the pinning force and depinning current as a function of the defect size and magnetic field. We also use periodic boundary conditions in the two-dimensional Ginzburg-Landau equations to solve for the known vortex-vortex interaction, in order to verify the resolution and accuracy of our approach for extreme type-II superconductors. Our direct numerical derivation of the pinning force per vortex is shown to be applicable to a wide range of magnetic fields and columnar-defect densities, and the calculated results are consistent with experimental observation.