Hindus are not required to cover their heads while worshipping. However, scriptures maintain that the top knot (Shikha-the tuft of the hair at the top of one's head) has to be maintained. If this Shikha is not there then one is considered to be "naked from the top". So, the Shikha itself acts as a head-cover.
The necessary quote for the above point is taken from this answer and is given below:
In the Prayoga Ratna of the author of Nirnaya Sindhu :—" The tuft
should be in the middle of the head, but of the Vasisthas towards
right, and of Atri and Kasyapa clans, on both sides." So also in the
Madhaviya. But Apastamba says : — "He combs the hair silently, and
arranges the locks in the fashion of his ancestral Risis." (Ap. G. S.
YI. 1ft. 6). According to the number of Pravara and Risi at the time
of initiation all these locks except the middle one are cut, from all
different directions. " He shaves his hair with the different Mantras,
towards the different (four) directions." (Ap. IV. 10. 6.) The
middle lock (called Sikha par excellence) should however be never cut
for Sruti prohibits it, and so also the Smriti :—" He is as if naked
and uncovered who is totally shaven, this Sikha is his covering." *'
A person without sikha and without sacred thread cannot perform any
sacred rite, for all that he does is unfructuous."
However, one is required to cover their heads when urinating and voiding excrement - that is during such acts which are considered as "unclean".
He should go about with his head uncovered during the day 36 and
covered at night. 37 He should cover his head also when he is
voiding urine or excrement,
Gautama Dharmasutras 9.35-37
In contrast, it is condemned if one eats with his head wrapped or covered with a cloth. And, eating is considered as a form of Yajna (an act of worship) in Hinduism.
- To eat one's meals with his head wrapped round, or with his face towards the south, or with his hand on his left foot, or while he is
standing up — is to imitate the manners of the Rakshasa class of
Parashara Smriti, Chapter 1, Verse 59
Manu Smriti 3.238. What (a guest) eats, covering his head, what he
eats with his face turned towards the south, what he eats with sandals
on (his feet), that the Rakshasas consume.
And, while performing Achamana (the first purificatory rite performed before all Hindu rituals) too, one should not keep one's head covered.
Three times he should sip water sufficient to reach his heart––without
laughing, talking, standing, or looking around; without bowing his
head or stooping; never with his topknot untied, his neck wrapped, or
his head covered;
Baudhayana Dharma Sutras 1.8.18-19
So, from all these references we can conclude that it is not mandatory for Hindus to keep their heads covered while performing auspicious acts like worshipping or even eating.
One should do so though while doing acts like urinating.