We propose an energy-stable parametric finite element method (ES-PFEM) to discretize the motion of a closed curve under surface diffusion with an anisotropic surface energy $gamma(theta)$ -- anisotropic surface diffusion -- in two dimensions, while $theta$ is the angle between the outward unit normal vector and the vertical axis. By introducing a positive definite surface energy (density) matrix $G(theta)$, we present a new and simple variational formulation for the anisotropic surface diffusion and prove that it satisfies area/mass conservation and energy dissipation. The variational problem is discretized in space by the parametric finite element method and area/mass conservation and energy dissipation are established for the semi-discretization. Then the problem is further discretized in time by a (semi-implicit) backward Euler method so that only a linear system is to be solved at each time step for the full-discretization and thus it is efficient. We establish well-posedness of the full-discretization and identify some simple conditions on $gamma(theta)$ such that the full-discretization keeps energy dissipation and thus it is unconditionally energy-stable. Finally the ES-PFEM is applied to simulate solid-state dewetting of thin films with anisotropic surface energies, i.e. the motion of an open curve under anisotropic surface diffusion with proper boundary conditions at the two triple points moving along the horizontal substrate. Numerical results are reported to demonstrate the efficiency and accuracy as well as energy dissipation of the proposed ES-PFEM.