Start the timer at the required interval, and then when it is marked for the first time, close the form. Something like that
private Timer _timer;
public PopupForm()
{
InitializeComponent();
_timer = new Timer();
_timer.Interval = 5000; // interval in milliseconds here.
_timer.Tick += (s, e) => this.Close();
_timer.Start();
}
In fact, the smartest way would probably put this in its own StartCountdown () method, which takes time as a parameter. Logic, as usual, should not be strictly stated in the constructor ...