We consider the problem of constructing transparent boundary conditions for the time-dependent Schrödinger equation with a compactly supported binding potential and, if desired, a spatially uniform, time-dependent electromagnetic vector potential. Such conditions prevent nonphysical boundary effects from corrupting a numerical solution in a bounded computational domain. We use ideas from potential theory to build exact nonlocal conditions for arbitrary piecewise-smooth domains. These generalize the standard Dirichlet-to-Neumann and Neumann-to-Dirichlet maps known for the equation in one dimension without a vector potential. When the vector potential is included, the condition becomes non-convolutional in time. For the one-dimensional problem, we propose a simple discretization scheme and a fast algorithm to accelerate the computation. This is the second version of the manuscript, correcting an important omission: namely the paper [1], which derived exact transparent boundary conditions from Green's representation theorem, as we do in Section 2 below. We have made minor changes to the presentation, emphasizing that the novelty of the present work is in the derivation of a fast algorithm which makes the Green's function-based approach practical.