Your periods will return any time from about six weeks to three months after your baby's birth if you are formula-feeding or combining breast and formula feeds. You are fertile two weeks before you have your period. So even if you're not ready to have sex just yet, you will need to start using contraception from three weeks to four weeks after your baby's birth.
If you're breastfeeding exclusively, and haven't started giving your baby solid food or formula milk, you may not need to worry about contraception yet. Your periods may not start again until you cut down breastfeeds or stop breastfeeding altogether. You could still be fertile before you realise it, though. So, using contraception will give you peace of mind.