We present results of a state-of-the-art computational study of the atomic and electronic structure of Cs2n+2MnMn′X6n+2 (M=Cu, Ag; M′=In, Bi; X=Cl, Br, I) layers with up to three-unit-cell thickness (n=3) as well as their bulk counterparts in the search for economical and stable halide double perovskites (HDPs) with a direct band gap and strong light absorption. Among the 24 layers we have studied, seven are found to be suitable for light emitting diodes, whereas one is proposed for solar cell applications. Our results on bulk Cs2AgM′X6 (M′=In, Bi; X=Cl, Br) HDPs agree with previous studies. Interestingly, we find that HDP layers as well as bulk are more stable than their respective lead-halide perovskites. The Cu-based HDPs are cost effective compared with those based on Ag and are found to be equally suitable as absorber materials with a lower band gap. However, bulk Cs2CuInX6 (X=Cl, Br) HDPs are found to be dynamically unstable. Our calculations show a combined effect of confinement and spin-orbit coupling in deciding the nature of the band gap for one (two)-unit-cell thick layers of Cs4AgBiX8 (Cs8Cu2Bi2X14). Furthermore, strong confinement effects are found to be crucial in making the thinnest layers of Cs4CuBiX8 (X=Cl, Br) direct band gap semiconductors. The reduction in the dimension from three to two dimensions introduces distortions in the layers of the HDPs, and it is more in the case of the Cu-based layers. The nature of the band gap becomes direct for very thin layers of Cs2n+2AgnBinX6n+2 (n=1) and Cs2n+2CunBinX6n+2 (n=1, 2) compared with indirect band gap in bulk. The HDP layers with a direct band gap and enhanced stability also have a strong absorption coefficient of the order of 105cm-1, making them interesting for solar cell applications. The effects of surfaces on the electronic structure of direct band gap layers of Cs2n+2CunBinBr6n+2 (n=1, 2) and Cs2n+2AgnInnCl6n+2 (n=3) are also shown with surface states. We hope that our results on HDPs will stimulate further research on these materials. © 2021 American Physical Society.