The first thing you need to know is how many hours (base hours and extra hours) you can work on the second option. For example, if it is 8 base hours a day at $15/hr, this is equal to $120/day. Estimating 26 working days/month, this is $3120/month, and $37440/year. Adding 1 extra hour each day (at $22.5/hr) would make your annual income $44,460, closer to the $45,000/year in the first option.
Aside from the exact number of base hours, other factors that would be important are the distance of the workplace (for example, if it is far away, transport expenses may be significant). Other workplace benefits and the environment may also factor in.