The DS1307 is a 5V device, is it not?
Putting massive delays right in the middle of your main control loop is far from advisable. Why not maintain a counter instead? Or implement hysteresis, so that the relay doesn't turn on until temp drops below 24, and doesn't turn off until temps rises above 26?