Cuban migrants are flocking to the U.S., federal data show, a trend experts attribute to fears that changing relations between the two countries could end America’s policy that permits residents of the island nation who reach the U.S. to remain here permanently.

Mainly over land, 31,314 Cubans entered the U.S. in the first nine months of the fiscal year that ends next week, up from about 26,000 migrants who entered in fiscal 2014, according to the Department of Homeland Security. Fewer than 7,500 Cubans came in 2010.

“There...