Energy from the sun is enough to provide for the world's energy requirements 12 times over. However, the cost of solar cell technology is still quite significant. Commercial solar cells currently use silicon which is expensive. Besides the high cost, poor light conversion efficiency is also an impediment for photovoltaics to be used more widely. Lead perovskites are a clear alternative to silicon for use in photovoltaic devices. They are valuable as photovoltaic materials because of their high light absorbance coefficient and the ability to tune bandgap. However, the poor stability of this material still prevents it from finding commercial use. One of the main reasons for perovskite instability is that because of its soft lattice, the perovskite ions migrate easily under light soaking and/or thermal stress. This dissertation investigates the phenomenon of halide ion and cation migration in perovskites – both bulk 3D and 2D perovskites, under light soaking and thermal annealing and suggests methods to control ion migration. Photoinduced halide ion migration and the resultant halide ion segregation in perovskites can be monitored spectroscopically. However, a quantification of ion migration is challenging because segregated mixed halide perovskites recover to their starting composition when in the dark. When mixed halide perovskites are irradiated in dichloromethane (DCM), iodine is observed to get expelled into DCM. This iodine that is expelled has a spectroscopic signature, which can be used to quantify the amount of iodine expelled and thus ion migration. We have demonstrated that iodine expulsion can be used to (1) quantify ion migration in mixed halide perovskites with various A-site cations and (2) to compare ion migration at different electrochemical biases. 2D layered perovskites have been considered to be a viable replacement for 3D perovskites because of higher stability owing to the hydrophobic spacer cations. For 2D perovskites to be integrated into devices, ion migration needs to be considered. By using 2D mixed halide perovskites, a spacer cation dependence of ion migration was discussed. Aromatic spacers like Phenethylammonium make 2D perovskites stable to ion migration, while 2D perovskites with aliphatic spacers like butylammonium are unstable. Finally, we demonstrate that cation migration occurs between 2D/3D perovskite interfaces on annealing. In physically paired 2D perovskite and 3D perovskite, it is observed on annealing that cations migrate resulting in the formation of higher layer numbers or quasi-2D perovskites. The projects described in this dissertation thus provide important insights into understanding the mechanism of ion migration in perovskites.