S1, caused by the atrioventricular valves closing, at the beginning of systole, and S2, caused by the aortic and pulmonary valves closing, at the beginning of diastole.
This pressure varies over the course of the cardiac cycle, increasing when blood is ejected from the heart(during systole), and decreasing as the heart relaxes(during diastole).
Right after the S2 sound, the tricuspid and mitral valves open back up allowing blood to fill up the ventricles again and this period of time is called diastole.
Now, the " DUB" sound — and, just to be clear, I am not talking about dubstep sounds — that's the aortic and pulmonary semilunar valves closing at the start of diastole.