Catalyzes the attachment of pyrrolysine to tRNA(Pyl). Pyrrolysine is a lysine derivative encoded by the termination codon UAG. ATP + L-pyrrolysine + tRNA(Pyl) = AMP + diphosphate + L-pyrrolysyl-tRNA(Pyl) Belongs to the class-II aminoacyl-tRNA synthetase family.