Cynthia Cheroitich, 19, said she drank body lotion because she was hungry and thirsty.
She was only brought out on Saturday morning after security forces found a teacher she knew to convince her it was safe to come out.
Ms Cheroitich said her ordeal began at around 05:30 (02:30 GMT) on Thursday when she and her fellow students were in class studying for their exams.
"Suddenly, we heard the bullets and then we started coming out and then we said: 'What is happening?'" she told the Associated Press news agency.
"We ran to our rooms, then these people came running, following us. When we reached our rooms, we hide under the beds."
She said that their pursuers told them to come out of their hiding places, but she decided to hide in the wardrobe instead where she covered herself with some clothes.
It was then that the gunmen entered the room. Ms Cheroitich described a scenario that other survivors have alluded to.
Her roommates were taken out and divided up between those who were able to recite verses of the Koran and those who were not.
It was not clear what happened to them.
She said she found some bottles of body lotion where she was hiding and "drank all of them", describing it as "nice and lovely".
But she was too scared to move. "I was just praying to my God," she said.
It was not until 10:00 on Saturday, long after the attack ended, that the authorities were able to persuade her to come out.
She told AP: "You know at first I did not believe it [when police came to rescue her], at first I was thinking that maybe they were the al-Shabab.  So I said: 'How do I know that you are the Kenyan police?'"
It was only after a member of the college staff came to convince her that it was safe to come out that she emerged.
A survivor of the al-Shabab attack on Kenya's Garissa university campus has been describing how she spent more than two days in a wardrobe in fear of rampaging militants.