Scattering lengths for two pseudoscalar meson systems, $\ensuremath{\pi}\ensuremath{\pi}(I=2)$, $KK(I=1)$ and $\ensuremath{\pi}K(I=3/2,1/2)$, are calculated from lattice QCD by using the finite size formula. We perform the calculation with ${N}_{f}=2+1$ gauge configurations generated on $3{2}^{3}\ifmmode\times\else\texttimes\fi{}64$ lattice using the Iwasaki gauge action and a nonperturbatively $\mathcal{O}(a)$-improved Wilson action at ${a}^{\ensuremath{-}1}=2.19\text{ }\text{ }\mathrm{GeV}$. The quark masses correspond to ${m}_{\ensuremath{\pi}}=0.17--0.71\text{ }\text{ }\mathrm{GeV}$. For the $\ensuremath{\pi}K(I=1/2)$ system, we use the variational method with the two operators, $\overline{s}u$ and $\ensuremath{\pi}K$, to separate the contamination from the higher states. In order to obtain the scattering length at the physical quark mass, we fit our results at several quark masses with the formula of the $\mathcal{O}({p}^{4})$ chiral perturbation theory and that includes the effects of the discretization error from the Wilson fermion, Wilson chiral perturbation theory. We found that the mass dependence of our results near ${m}_{\ensuremath{\pi}}=0.17\text{ }\text{ }\mathrm{GeV}$ are described well by Wilson chiral perturbation theory but not by chiral perturbation theory. The scattering lengths at the physical point are given as ${a}_{0}^{(2)}{m}_{\ensuremath{\pi}}=\ensuremath{-}0.04263(22)(41)$, ${a}_{0}^{(1)}{m}_{K}=\ensuremath{-}0.310(17)(32)$, ${a}_{0}^{(3/2)}{\ensuremath{\mu}}_{\ensuremath{\pi}K}=\ensuremath{-}0.0469(24)(20)$, and ${a}_{0}^{(1/2)}{\ensuremath{\mu}}_{\ensuremath{\pi}K}=0.142(14)(27)$. Possible systematic errors are also discussed.