There is little scientific evidence to suggest so. The reasoning behind covering your head after giving birth is that body heat is lost primarily through one's head and that a new mother needs to preserve her body heat to recover. Thus covering your head is believed to keep you warm and protect you from infections. This reasoning does not have scientific backing.
After giving birth, your immune system is weak, making you prone to infections. Giving birth is hard work. So you do need to take care until you have fully recovered. You can help yourself recover by:
Getting enough rest both during the day and night. Try to sleep at the same time as your baby and arrange for help in the house so you do not have to worry about household chores.
Eating a varied and well balanced diet. Do not restrict your diet after birth because this is the time that you need a variety of nutrients to help you recover. Read more on what to eat to help you recover from giving birth.
If you gave birth during winter and you feel cold, covering your head can help in preventing a cold. But you will then have to dress warmly in general, not only cover your head. There is no need to cover your head as a rule even when it is hot or humid outside to protect yourself from infections and speed up your recovery. Post-delivery confinement practices like staying indoors, getting plenty of rest and eating well will help you stay clear of infections. But if you feel feverish or unwell, be sure to contact your doctor.