We present new or improved methods to continue heteroclinic and homoclinic orbits to fixed points in iterated maps and to compute their fold bifurcation curves, corresponding to the tangency of the invariant manifolds. The proposed methods are applicable to general n-dimensional maps and are implemented in matlab. They are based on the continuation of invariant subspaces (CIS) algorithm, which is presented in a novel way. The systems of defining equations include the Riccati equations appearing in CIS for bases of the generalized stable and unstable eigenspaces. We use the bordering techniques to continue the folds, and provide full algorithmic details on how to treat the Jacobian matrix of the defining system as a sparse matrix in matlab. For a special - but important in applications - case n = 2 we describe the first matlab implementation of known algorithms to grow one-dimensional stable and unstable manifolds of the fixed points of noninvertible maps. The methods are applied to study heteroclinic and homoclinic connections in the generalized Hénon map.