If you choose to leave the church at any moment during the Divine Liturgy, no one is going to hold you back. The thing to consider is, though, whether it benefits you or not.
The Divine Liturgy is not just a sequence of awe-inspiring prayers and rituals. You can’t pick and choose more important prayers and distinguish them from the less important ones. The Liturgy is an undivided continuous prayer. It can be likened to a living being. An organism is handicapped and sick without one organ; likewise, the Liturgy won’t remain itself if you take just one prayer out of it. That is why those who aim to curtail the Divine Liturgy “because of people’s weakness” do bad.
This naturally leads us to the answer to your question. If the Liturgy cannot be curtailed, then a believer must pray during the entire Liturgy, not during some of its parts. Aside from that, the very question would leave first Christians puzzled: how can a person pray during the Liturgy and not take communion in the end?
On the whole, if we pay attention to the prayers of the Liturgy, we can’t help noticing that they all share the same goal: we ask God to make us worthy of partaking of his most pure Body and most honorable Blood. Consequently, if we spend the entire service praying with everyone else for God to let us be united with him through the Eucharist, and then, as soon as the priest appears from the altar carrying the Holy Gifts, we turn back and leave the church, doesn’t it mean that we were praying for something different than other believers? If so, it doesn’t matter when exactly we go out of the church: after the Lord’s Prayer or in the very beginning of the Liturgy.
Translated by The Catalog of Good Deeds