tl;dr : The Jewish tradition - be it the Torah, the Nevi'im, or the Rabinnical literature - is full of stories of not accepting HaShem's perspective, but aspiring HaShem to accept our perspective.
Some sources - not all - conclude that once we come to understand that HaShem is refusing to accept our prayer and that this refusal is an irrevocable edict, then we should reconcile ourself to HaShem decree.
[P.S. - Please excuse me for my grammar (I'm Hebrew native), and feel free to edit for correcting it.]
Here are several examples:
Moshe begged Hashem to let him enter Eretz Israel in spite of HaShem telling him that it is a punishment for its sin in Mey Meriva.
...ג, כג וָאֶתְחַנַּן, אֶל-יְהוָה, בָּעֵת הַהִוא, לֵאמֹר.
ג,כה אֶעְבְּרָה-נָּא, וְאֶרְאֶה אֶת-הָאָרֶץ הַטּוֹבָה, אֲשֶׁר, בְּעֵבֶר הַיַּרְדֵּן: הָהָר הַטּוֹב הַזֶּה, וְהַלְּבָנֹן.
And I besought the LORD at that time, saying: (...)
Let me go over, I pray Thee, and see the good land that is beyond the Jordan, that goodly hill-country, and Lebanon.
The Midrash has some very intriguing, lengthy interpretations for these Psukim:
- Midrash Dvarim Rabbah, Parash Yod-Aleph (Vezot Habracha), is saying that Moshe prayed 515 Tefilot (Gimartia of ואתחנן) and "made earth and skies shake", got refused prayer after prayer after prayer, but still didn't stop praying, trying to find the path to made its prespective be accepted. Only after he got refused for requesting HaShem to "leave him as an animal", and then "as merely a bird", he was left with no possibility but to accept the Din and bless HaShem:
כיון שראה משה, שאין בריה יכולה להצילו מדרך המות, באותה שעה אמר: הצור
תמים פעלו כי כל דרכיו משפט אל אמונה ואין עול צדיק וישר הוא.
[source of the above, in Hebrew]
- Midrash Tanchuma, Siman Vav (Va'etchanan), is saying that after Moshe got a refusal from HaShem, he went to asking the forces of nature to pass its prayers to HaShem, so that it may get accepted this way. They couldn't help him, though, and he got so frustrated that he put his hands on his head and start screaming and crying, with no one wanting to accept its prayers:
הניח משה ידיו על ראשו והיה צועק ובוכה, ואומר: אצל מי אלך לבקש עלי
Then, however, the Midrash takes a turn: HaShem turns to Moshe and instead of keeping answering its prayers with angry refusals, he turns to him and trying make him accept that this is the world's way: "Each and every generation has its own decisors, and each and every generation has its own leaders", and it is now the generation of Yehosua.
Moshe asks HaShem to let him enter Yehoshua's Beit Midrash, to learn Torah from him, and HaShem agrees - knowing that this is what Moshe needs to accept its death.
Yehoshua wasn't aware for the presence of its master. So Moshe sits there, listening to Yehoshua teaching, but simply can't understand its teachings! It is this experience that makes Moshe return back to HaShem and say: I can now accept Your eddict.
[source of the above, in Hebrew]
When we first being told about Hannah, we are told that each year she went to Shilo with her husband Elkanah, she wept and cried praying for a son.
There's an interesting word-phrasing in the Pasuk there:
א,י. (...) וְהִיא, מָרַת נָפֶשׁ; וַתִּתְפַּלֵּל עַל-יְהוָה, וּבָכֹה תִבְכֶּה.
(...) she was in bitterness of soul--and prayed unto the LORD, and wept
The Talmud (Brachot, 31b) says that "prayed unto the LORD" means that she spoke insolently toward HaShem ("הטיחה דברים כלפי מעלה").
Note also something interesting: Her husband tries to convince her to let go:
א,ח. (...) וַיֹּאמֶר לָהּ אֶלְקָנָה אִישָׁהּ, חַנָּה לָמֶה תִבְכִּי וְלָמֶה לֹא תֹאכְלִי, וְלָמֶה, יֵרַע לְבָבֵךְ: הֲלוֹא אָנֹכִי טוֹב לָךְ, מֵעֲשָׂרָה בָּנִים.
'Hannah, why weepest thou? and why eatest thou not? and why is thy
heart grieved? am not I better to thee than ten sons?'
while Pnina, Elkana's second wife, acts to make her angry and cause her to cry, so that its prayer will be accepted:
א,ו. וְכִעֲסַתָּה צָרָתָהּ גַּם-כַּעַס, בַּעֲבוּר הַרְּעִמָהּ: כִּי-סָגַר יְהוָה, בְּעַד רַחְמָהּ.
And her rival vexed her sore, to make her fret, because the LORD had
shut up her womb.
And time has passed (months? years? dozens of years? it it ambiguous: "וַיְהִי לִתְקֻפוֹת הַיָּמִים"), and finally HaShem accepted her prayer.
Well, no need to make things long: HaShem lets Satan hit Job, and Job demanded an answer: Why does he deserved it.
And while his wife told me to let go, surrender to his suffering and death ("ברך אלוהים ומות"), and his friends told him he probably have sinned, and that he can't speak to HaShem the way he does for more than 30 Prakim, HaShem finally reveals to him. And though rebuking him, Job has stands to its arguments, and there's an interesting discussion, though very unclear, between Job and HaShem for the following Prakim. Does Job accept HaShem's Din? hard to say with certainty.
Rabbi Hama Bar Hanina
There's an interesting saying of Rabbi Hama Bar Hanina (Brachot, 32b), concluding a short discussion, that in my interpretation regards the question: Should we keep praying if we see that our prayer is not answered?
Two different opinions are presented, but the Talmud chooses to conclude the disccussion with a saying in the name of Rabbi Hama Bar Hanina, supporting only one of these opinions, namely: Keep praying:
א"ר חנין א"ר חנינא כל המאריך בתפלתו אין תפלתו חוזרת ריקם מנא לן ממשה
רבינו שנא' (דברים ט) ואתפלל אל ה' וכתיב בתריה וישמע ה' אלי גם בפעם
ההיא איני והא א"ר חייא בר אבא א"ר יוחנן כל המאריך בתפלתו ומעיין בה סוף
בא לידי כאב לב שנא' (משלי יג) תוחלת ממושכה מחלה לב מאי תקנתיה יעסוק
בתורה שנא' (משלי יג) ועץ חיים תאוה באה ואין עץ חיים אלא תורה שנאמר
(משלי ג) עץ חיים היא למחזיקים בה לא קשיא הא דמאריך ומעיין בה הא דמאריך
ולא מעיין בה א"ר חמא בר' חנינא אם ראה אדם שהתפלל ולא נענה יחזור ויתפלל
שנאמר (תהילים כז) קוה אל ה' חזק ויאמץ לבך וקוה אל ה':
Note, however, that this discussion doesn't say "How long/much should we pray", nor "How should we know that our prayer won't be accepted", nor "Once we understand our prayer won't be accepted, we should accept HaShem decree".