The answer is: four.
For example compound carbon dioxide (CO₂):
Electron configuration of carbon: ₆C 1s² 2s² 2p².
Electron configuration of oxygen: ₈O 1s² 2s² 2p⁴.
Carbon atom is sp2 hybridized, it has three sp2 orbitals and one p orbital, they form four bonds.
Oxygen has two p orbitals, they form two bonds (one sigma and one pi bond).
p orbitals from carbon and oxygen overlap and form pi bond.