I study how relative wages and U.S. border enforcement affect immigration from Mexico to the United States. To do this, I estimate a discrete choice dynamic programming model where a person’s decisions depend on the location of their spouse. I use a new identification strategy to estimate the effect of border enforcement on immigration, accounting for the variation in the allocation of resources along the border. I estimate the model using data on individual immigration decisions from the Mexican Migration Project. Counterfactuals show that a 10% increase in Mexican wages would decrease the number of years spent in the U.S. by about 8%. A 50% increase in enforcement reduces immigration by up to 11.6%.