As Nigel says, toasters use a simple timer with on-off control to mains operated elements.
The so-called "microchip" toasters typically use something like a PIC 12 series MCU as a timer, plus a pot connected to its ADC for the user time setting (plus a relay or triac for controlling power to the elements).
With a bit larger PIC, a serial data digital display and a digipot or buttons, you can make a fully programmable timer to run for whatever time range(s) you need.
If you need temperature control, you can add a thermistor or PT100 type sensor and use an ADC in the PIC to read that and control power on/off appropriately.