New York is seeking to secure $21 billion in federal grants for a project that would lead to the construction of 12,000 affordable homes in the city, the mayor's office said.