Creating a timer using a Real Time Clock with start and stop times
I had a similar problem when i tried to control some heating source here at home.This was how I made my steps to get it working.
First I will assume you are using the library time.h and DS1307RTC.h (check here for info: https://www.pjrc.com/teensy/td_libs_Time.html).

Assuming that you will need 3 variables of the type tmElements_t.
tm will store your current time( the one you get from DS1307). The other two are auxiliary for defining time you start and time you stop the pump.
In similar way, you will need 3 variables of type time_t for the same reasons.
time_t variables store a the timestamps since 01/01/1970 (Unix epoch) which are easier to work with but tmElements structures are more human friendly.

tmElements_t tm, tm_hour_start, tm_hour_end;
time_t now, t_hour_start, t_hour_end;


Now in your loop you need to get the current time from rtc:

time_t now = RTC.get();


after, use the breaktime funtion to convert the timestamp value to tmElements struture:

breakTime(now, tm);


Next step is to copy contents of tm to the other auxiliary structures, use the memcpy function:

memcpy(&amp;tm_hour_start, &amp;tm, sizeof(tm));
memcpy(&amp;tm_hour_end, &amp;tm, sizeof(tm));


after, change the the auxiliaries vars to meet your correct schedule of start and stop (are seconds important? if so, do similar way):

tm_hour_start.Hour = startHour;
tm_hour_start.Minute = startMinute;
tm_hour_start.Second = 0;
tm_hour_end.Hour = endHour;
tm_hour_end.Minute = endMinute;
tm_hour_end.Second = 0;


Ok, we have the more human friendly start and end structures, lets get the timestamps from them. To do soo we use the makeTime function that converts tmElements_t structures to time_t:

t_hour_start = makeTime(tm_hour_start);
t_hour_end = makeTime(tm_hour_end);


All you need to do now, is check if your current timestamp (now) is between this newly created timestamps:

if ((t_hour_start &lt;= now) &amp;&amp; (now &lt;= t_hour_end)){
   //do something is soo...
}else{
   // do something if not...
}


Extra tip: In case your stop hour goes past midnight, add one more day to the timestamp:

if (startHour &gt; endHour) //past midnight correction
   t_hour_end = t_hour_end + SECS_PER_DAY;


clean code:

#include &lt;time.h&gt;
#include &lt;DS1307RTC.h&gt;
#include &lt;stdio.h&gt;
// other includes etc...

byte startHour=8
byte startMinute=15
byte endHour= 14
byte endMinute= 20

tmElements_t tm, tm_hour_start, tm_hour_end;
time_t now, t_hour_start, t_hour_end;

// setup function and other needed things...    

void loop(){
  //get current timestamp
  time_t now = RTC.get();
  // make current date and time structure
  breakTime(now, tm);
  // make auxiliary structures to be more human editable and friendly
  memcpy(&amp;tm_hour_start, &amp;tm, sizeof(tm));
  memcpy(&amp;tm_hour_end, &amp;tm, sizeof(tm));
  // change auxiliary structures to meet your start and end schedule 
  tm_hour_start.Hour = startHour;
  tm_hour_start.Minute = startMinute;
  tm_hour_start.Second = 0;
  tm_hour_end.Hour = endHour;
  tm_hour_end.Minute = endMinute;
  tm_hour_end.Second = 0;
  // reverse process to get timestamps
  t_hour_start = makeTime(tm_hour_start);
  t_hour_end = makeTime(tm_hour_end);
  // check if end time is past midnight and correct if needed
  if (startHour &gt; endHour) //past midnight correction
       t_hour_end = t_hour_end + SECS_PER_DAY;

  //final part   
  if ((t_hour_start &lt;= now) &amp;&amp; (now &lt;= t_hour_end)){
          //do something is soo...
  }else{
          // do something if not...
  }

}


EDIT: to correct the thing about midnight checks spotted in comments. New code:

#include &lt;Wire.h&gt;
#include &lt;Time.h&gt;
#include &lt;DS1307RTC.h&gt;
#include &lt;stdio.h&gt;
// other includes etc...

byte startHour = 8;
byte startMinute = 15;
byte endHour = 14;
byte endMinute = 20;

tmElements_t tm, tm_hour_start, tm_hour_end;
time_t now_, t_hour_start, t_hour_end;
boolean update_tm = 1;



// setup function and other needed things...    
void setup(){};

void loop(){
  //get current timestamp
  time_t now_ = RTC.get();
  // make current date and time structure
  breakTime(now_, tm);
  // make auxiliary structures to be more human editable and friendly
  if(update_tm){
    memcpy(&amp;tm_hour_start, &amp;tm, sizeof(tm));
    memcpy(&amp;tm_hour_end, &amp;tm, sizeof(tm));
    // change auxiliary structures to meet your start and end schedule 
    tm_hour_start.Hour = startHour;
    tm_hour_start.Minute = startMinute;
    tm_hour_start.Second = 0;
    tm_hour_end.Hour = endHour;
    tm_hour_end.Minute = endMinute;
    tm_hour_end.Second = 0;
    // reverse process to get timestamps
    t_hour_start = makeTime(tm_hour_start);
    t_hour_end = makeTime(tm_hour_end);

    // check if end time is past midnight and correct if needed
    if (startHour &gt; endHour) //past midnight correction
      t_hour_end = t_hour_end + SECS_PER_DAY;
  }
  //final part   
  if ((t_hour_start &lt;= now_) &amp;&amp; (now_ &lt;= t_hour_end)){
    /* if we got a valid schedule, don't change the tm_hour structures and the 
    respective t_hour_start and t_hour_end timestamps. They should be updated 
    after exiting the valid schedule */
    if(update_tm)  
      update_tm = 0;

    //do something is soo...
  }else{
    if(update_tm == 0)  
      update_tm = 1;
    // do something if not...
  }

}