We develop a finite element adaptive strategy with error control for the wave scattering by periodic structures. The unbounded computational domain is truncated to a bounded one by an extension of the perfectly matched layer (PML) technique, which attenuates both the outgoing and evanescent waves in the PML region. PML parameters such as the thickness of the layer and the medium property are determined through sharp a posteriori error estimates. Numerical experiments are included to illustrate the competitive behavior of the proposed adaptive method.