Housing affordability has become the main policy challenge for most large cities in the world. Zoning, rent control, housing vouchers, and tax credits are the main levers employed by policy makers. We build a new dynamic stochastic spatial equilibrium model to evaluate the effect of these policies on house prices, rents, residential construction, labor supply, output, income and wealth inequality, as well as the location decision of households within the city. The analysis incorporates risk, wealth effects, and resident landlords. We calibrate the model to the New York MSA, incorporating current zoning and rent control policies. Our model suggests sizable welfare gains from relaxing zoning regulations in the city center, as well as from expanding rent control and housing voucher programs. Housing affordability policies have a substantial insurance value which offsets efficiency losses due to the misallocation of labor and housing. The calibrated model implies gains in social welfare from policies that reduce housing inequality.