There is a scene in which my main character is hiding from the villain while they are both in the same room. I want this to be a suspenseful and agonizing stretch of time, but I’m not sure how to show how long it feels for the character without it becoming boring or using cliche phrases like “every second felt like an hour.”
What does the time spend hiding do to your character? Pick things that start off easy to manage, but becomes hard to maintain (especially under stress or pressure), and talk about those. For example, if they are squeezed into a wardrobe, staying as still as possible:
As the villain paced the room, she shivered in her hiding spot. Every time he walked out of view of the thin gap between the doors, her heart jumped with the fear that he would approach the wardrobe, fling it wide open, and catch her. The effort to keep her breathing slow and quiet began to feel like Sisyphus pushing a boulder uphill, straining to keep it from rolling back down, picking up speed and sound on its way to the bottom in a crushing defeat.
Her arms and legs started to tremble, the exertion of staying in one place for so long gradually building up in a slow burn, the urge to move, to scratch, to do anything but stay safely hidden growing with every passing moment. The beating of the blood in her veins seemed to boom out, and she was sure he would hear it, the agonising torment of "what if"s playing through her mind in an unending saga of paranoia.
And then, mercifully, he left. At first, she remained frozen - almost expecting him to burst back in the moment she moved. Gradually, she let out a long, deep breath, tension draining from her frame as she slid down the wall and sank to the floor with a faint scrawp of cloth on wood. That was close.
One possibility is to just say that time has passed. "The two men sat staring at each other, neither saying a word, for fifteen minutes."
Another possibility is to fill the time with action. If the point is that it was a tense standoff, "action" here probably doesn't mean people running and fighting, but events appropriate to the situation. "Bob locked the door behind him. He leaned against the wall and breathed heavily, trying to catch his breath. He listened carefully for signs of pursuit. He strained to hear any sound coming from outside. All he could hear were the noises of traffic in the street. At one point he heard a voice. He was afraid that it was THEM in the hall, but as he strained to make out the words he realized it was just two people talking about being late for some social event." Etc.
My favorite way to pass time to to make the characters get lost in their thoughts.
What was that? A floorboard creeking? It must just be a mouse. At least Jim hoped it was. It wasn't supposed to end this way... ever since he sold the doughnuts to Sally, she had begun to suspect that they were running an underground operation.
How could he have known that such a simple action would end up betraying them? But it was too late to be filled with regret now.
Continue along these lines for several paragraphs.
Think about what your characters are doing during the long periods of hiding. Are they thinking? Playing cards? Planning their escape?
Show the reader how slow time is passing.
Another way is to make the characters confused about the passing of time.
Everything was quiet. Was it safe to come out? Jim cracked the door open. Light from the opposing window flooded the closet.
How could it still be daylight?
Jim closed the door again and continued to wait for night to fall.
There are some great answers to this question already. I could see many scenarios where one could use a mix of the suggestions in the answers.
Another idea is to use visual cues, such as sunlight, to suggest that time has passed;
Tom pulled the door from inside the cabinet, leaving it just open enough to see the table in the room across the hall, where the sunlight beamed in and bathed the wooden tabletop in a deep amber glow.
[Insert character's thoughts here like in the other answers]
Tom took his hand from his mouth and drew what felt like the first natural breath in hours. He peeked through the opening and once again saw the wooden table in the room across the hall. He could tell that the room was still lit from the daylight, but the sunlight no longer hit any part of the table directly.
How long had he been hiding in the closet?
A similar observation could be made about the sun going down or no longer shining into the cabinet, the streets falling quiet post-rush-hour, the construction worker's radio no longer playing, his watch beeping to remind him of taking his insulin, the battery of ___ running out, etc.
Use the knowledge of your character(s) to find something that makes sense for that character to notice and experience.
Is your villain searching for the main character? Or is it a standoff? You could perhaps briefly elaborate on what the villain is doing in the room and how the main character (if hidden) can see the villain's every move. Possibly explain what the main character is going through at that moment(elevated heart rate, sweaty palms, fast breaths, and so on) or what the main character is doing if the villain is close to discovering the main character's hideout. This should, in my opinion, give a sense of extended time to the reader while keeping them occupied in the storyline.