It is of great significance to reveal the influence on the output performance of pneumatic hammers under different drilling condition parameters to improve their impact efficiency used in drilling applications. In this study, Computational fluid dynamics (CFD) wisth dynamic mesh method was utilized to simulate dynamic airflow and piston movement within the hammer. User-Defined Functions (UDFs) are modified to introduce friction and varying well deviation angles. Meanwhile, a test bench of pneumatic hammer performance is designed and built to record real-time data on the piston displacement and chamber pressure within the hammer, validating the simulation results. The results show that the simulated and experimental data exhibit similar values and trends, with a maximum error of 10.92% for the impact velocity, 9.5% for the impact frequency, 8.36% for the maximum piston displacement, and 10.81% for the pressure drop, respectively. In addition, the piston motion mechanism was analyzed and the effects of well deviation angle, mass-flow rate, backpressure, restitution coefficient, and friction coefficient on the hammer's performance were investigated in detail. The results indicate that the mass-flow rate and restitution coefficient have a positive effect on increasing the piston's impact velocity and impact frequency, as well as pressure drop. In the context of directional drilling, the hammer's impact energy varies with the well deviation angle. At lower values of the friction coefficient, a clear positive correlation emerges between impact energy and deviation angle. Conversely, at larger values of the friction coefficient, a distinct biphasic behavior is observed, with the impact energy first decreasing before subsequently increasing. Furthermore, the backpressure, and friction coefficient adversely affect the hammer performance, with the backpressure being the dominant factor.