This circuit is a standard way of driving Small Power Relays from Control Signals generated by Logic or Opamp Circuits.
C2 and R5 form a snubber which improves the life of the metal contacts, the contacts can erode due to sparking when switching inductive or even big loads. reduces EMI_RFI.
Basics of Electronics
The Electromagnetic Solenoid Coil is rated by Volts and Ohms. If you choose 12V ensure a stable 12V is provided, more voltage will heat coil, less voltage will cause sparking or will drop out the magnetic holding. A high coil resistance is better as the heat will be less and power consumption of your design is low.
Read more »