The circuit below is a simple timer based on the popular 555 IC. Time is set by the R1 potentiometer. This is actually a one shot pulse generator.
Normally, the relay is held off while the output at pin 3 is at a logic 0 level. A momentary touch on S1 switch, energizes the relay which is held closed for a fixed period of time tH, and then released. The tH is equal to 1.1x(R1+R2)xC1.
The circuit should be calibrated for various positions of the control knob of R1.
The relay should be of a DC type with a coil operating at about Vcc and not drawing more than 200mA. A relay is an inductive load and when its current is interrupted, the collapsed magnetic field (due to its coil) generates a high reverse emf (transient voltage) that can damage the 555. The solution to this problem is the connection of diode D2 across the relay coil so that it conducts and absorbs the transient. D2 is connected in such polarity so it remains reverse biased in normal operation.
There is also the D1 diode which is inserted in series with the relay coil. This is to prevent the appearance of a voltage equal to one diode-junction drop at pin 3 which may cause the timer to latch up.