Traditional fossil fuels significantly contribute to energy supply, economic development, and advancements in science and technology. However, prolonged and extensive use of fossil fuels has resulted in increasingly severe environmental pollution. Consequently, it is imperative to develop new, clean, and pollution-free energy sources with high energy density and versatility as substitutes for conventional fossil fuels, although this remains a considerable challenge. Simultaneously, addressing water pollution is a critical concern. The development, design, and optimization of functional nanomaterials are pivotal to advancing new energy solutions and pollutant remediation. Emerging porous framework materials such as metal-organic frameworks (MOFs) and covalent organic frameworks (COFs), recognized as exemplary crystalline porous materials, exhibit potential in energy and environmental applications due to their high specific surface area, adjustable pore sizes and structures, permanent porosity, and customizable functionalities. This work provides a comprehensive and systematic review of the applications of MOFs, COFs, and their derivatives in emerging energy technologies, including the oxygen reduction reaction, oxygen evolution reaction, hydrogen evolution reaction, lithium-ion batteries, and environmental pollution remediation such as the carbon dioxide reduction reaction and environmental pollution management. In addition, strategies for performance adjustment and the structure-effect relationships of MOFs, COFs, and their derivatives for these applications are explored. Interaction mechanisms are summarized based on experimental discussions, theoretical calculations, and advanced spectroscopy analyses. The challenges, future prospects, and opportunities for tailoring these materials for energy and environmental applications are presented.