New York on Monday became the 23rd state to legalize certain forms of marijuana for medical reasons as Gov. Andrew Cuomo signed legislation into law at an event in Manhattan.

The measure, which passed both houses of the legislature during the final moments of the legislative session, in June, is significantly more restrictive than other medical-marijuana laws in the nation.

It...