It is dubious that this statement has any legal standing. The city comptroller promulgates immigrant-rights information which says the predictable things about the right to remain silent, asking if you are free to go, and so on in the form of a know your rights sheet. It correctly states that the city will not cooperate with federal authorities in enforcing immigration laws, except when required by law. Executive order 41 prohibits the city from disclosing immigration-status information. The closest statement other that the claim in the OP is the section on public schools:
if a federal enforcement officer or immigration enforcement officer
approaches a public school, the school will ask the officer for
detailed information about the nature of the visit and whether the
officer has any paperwork or warrants. The school will then instruct
the officers to wait outside of the school building while school staff
consult with attorneys at the New York City Department of Education
(DOE). Public schools will not give any information to such officers
or allow such officers to enter any schools unless it is absolutely
required by law.
The statement that federal officers "cannot enter hospitals, schools, or shelters" is an exaggeration. With a warrant, they can enter, period. With permission of the owner, they can enter without a warrant (which will be denied in public school, but not automatically in all schools). Incidentally, their statement cannot be interpreted to mean that a federal law enforcement officer cannot seek medical assistance – this denial of permission to enter surely must be specifically restricted to "entering for the purpose of enforcing federal immigration law, when permission or a warrant is required".
The exact "non-cooperation" rules are set forth in Local Laws 58 and 59 of 2014.