A Long Island man was sentenced to 25 years in prison after admitting to sexually assaulting his granddaughter for years, Suffolk County District Attorney Raymond A. Tierney announced Tuesday.