  A sample of 3984 candidates of the $K^+\to\pi^+\gamma\gamma$ decay, with an
estimated background of $291\pm14$ events, was collected by the NA62 experiment
at CERN during 2017-2018. In order to describe the observed di-photon mass
spectrum, the next-to-leading order contribution in chiral perturbation theory
was found to be necessary. The decay branching ratio in the full kinematic
range is measured to be $(9.61\pm0.17)\times10^{-7}$. The first search for
production and prompt decay of an axion-like particle with gluon coupling in
the process $K^+\to\pi^+a$, $a\to\gamma\gamma$ is also reported.
