In the myth, Cupid only comes to Psyche in the dark, so she doesn't know who he is or what he looks like. What's Cupid's motivation for hiding his identity? Was he planning to do that indefinitely if Psyche hadn't disobeyed his order and took a peek at his face?
In The Golden Ass, Cupid does not give any reason why explicitly. He simply forbid her:
But he gave her a further charge saying, Beware that ye covet not (being moved by the pernicious counsel of you sisters) to see the shape of my person, lest by your curiosity you deprive your selfe of so great and worthy estate.
When he realizes she disobeyed him, his reaction centers on that:
The god beeing burned in this sort, and perceiving that promise and faith was broken, hee fled away without utterance of any word,
and in a later reproach, he does mention that he disobeyed his mother but not that he forbade her because of that.
But Cupid followed her downe, and lighted upon the top of a Cypresse tree, and angerly spake unto her in this manner: O simple Psyches, consider with thy selfe how I, little regarding the commandement of my mother (who willed mee that thou shouldst bee married to a man of base and miserable condition) did come my selfe from heaven to love thee, and wounded myne owne body with my proper weapons, to have thee to my Spowse: And did I seeme a beast unto thee, that thou shouldst go about to cut off my head with a razor, who loved thee so well?
(It is possible that it was forbidden so she could break the command, as it's the standard trope in this kind of fairy tale, but that we can only speculate about.)
Cupid hides himself because he is a god, and also because he was ordered by Venus to kill Psyche but instead falls in love with her. So to shield his identity and his true self from Psyche, he only appears in the dark so that she doesn't see the true majesty that he is and so that the message would not get back to Venus who is his mother that he in fact betrayed her trust and orders by not killing Psyche.
It's a test. Cupid is the heart, Psyche is the mind. The story is about trusting your emotions over your reason (or gossip, or relatives, come to that) when it comes to love/marriage. He wanted her to trust him (to trust in her emotions) until he was satisfied that she was loyal to him and not her birth family, or until she proved that she had conquered her own doubts and would obey her husband (appalling now, but an appropriate sentiment at the time).
Tests in Greek mythology are not indefinite, although Psyche fails this one without the terms ever being announced, so we don't know how long it might have gone. In mythological terms, "until she fell in love with him" is probably a good rough deadline. She would have had to fake it ’til she made it, so to speak.