After a long wait, New York City has received a $7.6 million state grant for a program that will keep approximately 5,000 low-income students in class for at least an extra 300 hours next year.

Schools will be able to add those hours before school, on the weekends, or during the summer, and will partner with one of three organizations to create and staff the programs: The After School Corporation, the National Center for Time and Learning, or Generation Schools Network.

Gov. Andrew Cuomo’s grants are designed to tackle the same problems as the $145 million after-school expansion that Mayor Bill de Blasio is undertaking in middle schools. By the time poor children enter sixth grade, they’ve already been exposed to about 6,000 fewer hours of learning than their more affluent counterparts, advocates estimate.

But the state grant won’t fund de Blasio’s initiative, a Department of Education spokeswoman said, and there are several key differences between the programs.

De Blasio’s program costs $3,000 per student and will expand the day by three hours in the afternoon for 36 weeks, about 540 hours for the entire year. Cuomo’s grants allocate half that much money and will fund about 300 extra hours of learning each year that can be added at different times.

It’s unclear how the city will choose the schools to receive the grant funding, but about 25 percent of city schools aren’t eligible because they are charter schools or don’t have enough poor students.

The city is one of nine districts that won a portion of $24 million from the State Education Department, which posted a list of the winners on its website.

Gov. Andrew Cuomo first touted the idea of extended learning time grants 18 months ago as a way to narrow the achievement gap for poor students. Districts submitted their applications in October and some were planning to start programs this school year, but sources say the governor’s office delayed its final approvals.

Multiple calls and emails to the governor’s office were not returned.