Turn on relay when voltage larger then 13v
You want an inverting comparator with hysteresis.  This configuration is explained in this "Comparator with Hysteresis Reference Design" application note.



The resistor values are calculated as follows (using the equations in the ap note, example on page 7).

A voltage divider made up of R1 (33.2k) and R2 (11k) is used to divide the input voltage by about 4, so it fits within the range of the comparator input.  13v => 3.23 (Vh), and 12v => 2.98v (Vl).

\$\frac{Rh}{Rx} = \frac{Vl} {Vh - Vl} = \frac{2.98} {3.23 - 2.98} = 11.92\$

\$\frac{Ry}{Rx} = \frac{Vl} {Vcc - Vh} = \frac{2.98} {5 - 3.23} = 1.68\$

\$Rh = 11.92 \times Rx\$

\$let\,Rx = 10k\$

\$Rh = 119.2k; \,closest\,1\%\,value\,is\,118k\$

\$Ry = 1.68 \times Rx\$

\$Ry = 16.8k; \,closest\,1\%\,value\,is\,16.9k\$

The inverting output of the comparator can be used to drive the input of a P-channel MOSFET hi-side switch, which will invert the signal a second time.  When Vin goes above 13v, the comparator will turn off, turning on the MOSFET and the relay.  When Vin falls below 12v, the comparator will turn on, turning off the MOSFET and the relay.