Usually, only the first two can be heard (S1 and S2). The 3rd and the 4th can be appreciated only in particular conditions.
The first one (S1) is the closing of the atrioventricular valves (systolic phase). Actually the sound is composed by two parts: the mitralic sound and the tricuspid sound. Normally the left AV is the first one to close and then the right AV, because of the different pressure (greater in the part of the heart).
The second one (S2) is the end of the systolic phase and it's caused by the closing of the semilunar valves. Also here we have two parts, first the aortic valve and then the pulmunary one. During a deep inspiration it could be heard the doubling of S2, because the decreasing of the pulmonary circulation's resistance. In this way the pulmonary valve needs more time to close, causing the doubling. A missing doubling of S2 could suggest pulmonary hypertension.
The third sound (S3) can be heard in both physiological and pathological conditions. It coincides with the ventricular filling (diastolic phase), in which the blood turbulence causes the stretching of the tendinous cords concurring to produce this sound. It's audible in high ventricular filling velocity and/or increased blood volume in the ventricle. In young people and athletes S3 can be heard without any pathological meaning (it's caused by a greater contraction strength), but can be heard also in hypofunctioning ventricles.
The S4 corresponds to pre-systolic phase (atrial systole). It's always pathologic, if audible. It can be heard when the atrium contract with more strength than normal. It's usually heard in ventricular hypertrophy.
Below some examples of heart sounds.
S1 - S2
S1 - S2 - S3
S4 - S1 - S2