The federal government is increasingly taking money out of Americans’ Social Security checks to recover millions in unpaid student debt, a trend set to accelerate as more baby boomers retire.

The government has collected about $1.1 billion from Social Security recipients of all ages to go toward unpaid student loans since 2001, including $171 million last year, the Government Accountability Office said Tuesday. Most affected recipients in fiscal year 2015—114,000—were age 50 or older and receiving disability benefits, with...