Let x = the number of hours that Mary rented the bike. Then we have the following equation based on the info given in the problem:
12 + 8x = 52
You should be able to solve this linear equation for x to determine how long Mary checked the bike out from the shop, Alisha.