Oyster shells (OSs) were pyrolyzed at 300 °C, 600 °C, and 900 °C to produce oyster shell biochars (OSB300, OSB600, and OSB900, respectively). The physicochemical properties and adsorption mechanisms for the removal of Cd and Pb by the biochars were then investigated. The results indicated that the calcite in OS decomposed into CaO at 900 °C, which may further influence its adsorption capacity. OSBs had a higher affinity for Pb than Cd as they could hydrolyze Pb more easily. OSB900 exhibited superior adsorption performance for Cd (153.8 mg·g−1) in batch adsorption, but the lowest adsorption performance for Pb (923.3 mg·g−1). Furthermore, the Pb adsorbed on OSB900 mainly presented as stable carbonate precipitation (Pb3(CO3)2·Pb(OH)2). Soil amendment with OSB900 at a 0.5% dosage most effectively decreased the CaCl2-extractable Cd and Pb by up to 98% and 88%, respectively. These findings suggest that OSBs are suitable for Cd and Pb immobilization in both wastewater and contaminated soil.