Local residents say the militants entered the College of Agriculture in Gujba at about 1.00 am local time and opened fire on students while they were asleep. Eyewitnesses say the heavily-armed gunmen also torched classrooms.
Security forces and rescue teams are still recovering the bodies.
Boko Haram says its aim is to topple the Nigerian government, which it accuses of being pro-Western.
The group has claimed responsibility for a number of deadly attacks in the country since 2009.
The developments come after at least 27 people were killed in two separate attacks by members of the militant group in northeastern Nigeria, according to a government official.
Local government official Alhaji Modu Gana Sheriff told reporters on Saturday that six people were killed in an attack on Wednesday night in the town of Gamboru in Borno state and another 21 were killed on Thursday night in the same town.
In May 2013, the Nigerian government imposed a state of emergency in three states in the northeast, saying Boko Haram had become a security threat in those states.