We investigate the kinetics of loop formation in ideal flexible polymer chains (the Rouse model), and polymers in good and poor solvents. We show for the Rouse model, using a modification of the theory of Szabo, Schulten, and Schulten, that the time scale for cyclization is tau(c) approximately tau(0)N(2) (where tau(0) is a microscopic time scale and N is the number of monomers), provided the coupling between the relaxation dynamics of the end-to-end vector and the looping dynamics is taken into account. The resulting analytic expression fits the simulation results accurately when a, the capture radius for contact formation, exceeds b, the average distance between two connected beads. Simulations also show that when a < b, tau(c) approximately N(alpha)(tau), where 1.5 < alpha(tau) < or = 2 in the range 7 < N < 200 used in the simulations. By using a diffusion coefficient that is dependent on the length scales a and b (with a < b), which captures the two-stage mechanism by which looping occurs when a < b, we obtain an analytic expression for tauc that fits the simulation results well. The kinetics of contact formation between the ends of the chain are profoundly effected when interactions between monomers are taken into account. Remarkably, for N < 100, the values of tau(c) decrease by more than 2 orders of magnitude when the solvent quality changes from good to poor. Fits of the simulation data for tau(c) to a power law in N (tau(c) approximately N(alpha)(tau)) show that alpha(tau) varies from about 2.4 in a good solvent to about 1.0 in poor solvents. The effective exponent alpha(tau) decreases as the strength of the attractive monomer-monomer interactions increases. Loop formation in poor solvents, in which the polymer adopts dense, compact globular conformations, occurs by a reptation-like mechanism of the ends of the chain. The time for contact formation between beads that are interior to the chain in good solvents changes nonmonotonically as the loop length varies. In contrast, the variation in interior loop closure time is monotonic in poor solvents. The implications of our results for contact formation in polypeptide chains, RNA, and single-stranded DNA are briefly outlined.