Transient pressure analysis is a crucial tool to forecast the production performance during the exploration and production process in gas reservoirs. Usually, a regular shaped outer boundary is assumed in previous studies for well-testing analysis, which is just a simplification of practical cases and cannot reflect the actual boundaries of reservoirs. In this paper, a mathematical model is established to analyze the transient pressure behaviors of a horizontal well in an arbitrarily shaped gas reservoir. Dimensionless treatment, Laplace transformation, and boundary element method are applied in solving the model, which is verified by comparing with the results from the source function method. Based on the Stehfest numerical inversion method, the models of single-porosity media and dual-porosity media are solved respectively. Then, the time-domain curves of pseudo pressure and its derivative are obtained, and the flow regimes are identified. Finally, the impacts of some critical parameters on pressure transient behaviors are analyzed, including storativity ratio, interporosity coefficient, well length, and well orientation. This paper presents an effective way to handle complex external boundary problems in gas reservoirs.