The answer to the given question is “Yes” and “Yes” but allow me to elaborate on that a bit. When Jesus taught his disciples how they ought to pray in Matthew 6:9-13 he instructed them to pray to “Our Father in heaven.”
9Pray then like this: “Our Father in heaven, hallowed be your name. 10 Your kingdom come, your will be done, on earth as it is in heaven. 11Give us this day our daily bread, 12and forgive us our debts, as we also have forgiven our debtors. 13And lead us not into temptation, but deliver us from evil.
So it was Jesus Himself, God in flesh (John 1:1-14), who told us that we should raise our prayers directly to God, namely, God the Father. The Bible teaches that God has existed eternally as one being in three persons, Father, Son and Holy Spirit. This doctrine is known as the Trinity. This is why Jesus can both be God and still pray to God (e.g. John 17) because while they share the same being they are different in person.
Each person of the Trinity plays different roles in how they interact in the lives of believers and unbelievers alike. When it comes to our given topic of prayer, the Bible teaches that it is God the Father whom we ought to direct our prayers to, but it also teaches that it is through Jesus that we have that kind of direct access to the Father. Consider the verse in Mark 15:38; “And the curtain of the temple was torn in two, from top to bottom.” This “curtain” is the one that separated people from the Holy of Holies (aka “The Most Holy Place”) in the temple, the place where God’s presence dwelled in a special sense. The Holy of Holies was the place where once a year a priest would enter after having carefully observed all of the purification rituals that were required before entering into God’s presence and make a sacrifice for the unintentional sins of the people of Israel (intentional or known sins were to be dealt with on a regular basis). The curtain was torn in two by God at the time of Jesus’ death on the cross. Hebrews 9:1-14 tells us how through Christ’s death we no longer are separated from God by the curtain.
1Now even the first covenant had regulations for worship and an earthly place of holiness. 2 For a tent was prepared, the first section, in which were the lampstand and the table and the bread of the Presence. It is called the Holy Place. 3 Behind the second curtain was a second section called the Most Holy Place, 4 having the golden altar of incense and the ark of the covenant covered on all sides with gold, in which was a golden urn holding the manna, and Aaron’s staff that budded, and the tablets of the covenant. 5 Above it were the cherubim of glory overshadowing the mercy seat. Of these things we cannot now speak in detail. 6 These preparations having thus been made, the priests go regularly into the first section, performing their ritual duties, 7 but into the second only the high priest goes, and he but once a year, and not without taking blood, which he offers for himself and for the unintentional sins of the people. 8 By this the Holy Spirit indicates that the way into the holy places is not yet opened as long as the first section is still standing 9 (which is symbolic for the present age). According to this arrangement, gifts and sacrifices are offered that cannot perfect the conscience of the worshiper, 10 but deal only with food and drink and various washings, regulations for the body imposed until the time of reformation. 11 But when Christ appeared as a high priest of the good things that have come, then through the greater and more perfect tent (not made with hands, that is, not of this creation) 12 he entered once for all into the holy places, not by means of the blood of goats and calves but by means of his own blood, thus securing an eternal redemption. 13 For if the blood of goats and bulls, and the sprinkling of defiled persons with the ashes of a heifer, sanctify for the purification of the flesh, 14 how much more will the blood of Christ, who through the eternal Spirit offered himself without blemish to God, purify our conscience from dead works to serve the living God.
This passage explains that in the Old Covenant, under the law, the priest had to continually offer sacrifices again and again for the people of Israel because the sacrifices were imperfect, they never actually fully appeased God’s wrath for sin, hence the need to repeat the sacrifice. Jesus, however, was the perfect lamb of God (John 1:29; 36), the sinless one, He was the perfect sacrifice that God was pleased with. When Christ died on the cross and the curtain was torn that separated the people from the Most Holy Place in the temple this indicated that man no longer needed to approach God through priests and through repetitive sacrifices. It is in Christ that we have a perfect sacrifice, and it was paid once and in full! Just as it says in Hebrews 10:12-14:
“12 But when Christ had offered for all time a single sacrifice for sins, he sat down at the right hand of God, 13 waiting from that time until his enemies should be made a footstool for his feet. 14 For by a single offering he has perfected for all time those who are being sanctified.”
Jesus became our high priest before God, always making intercession for us. It is because of this Jesus’ sacrifice that the New Covenant was ushered in (Luke 22:20) and we now no longer depend on earthly priests to come before God for us, but through Christ, we may directly and boldly approach God’s throne with our prayers. Again in Hebrews 7:23-27 it says:
23 The former priests were many in number, because they were prevented by death from continuing in office, 24 but he holds his priesthood permanently, because he continues forever. 25 Consequently, he is able to save to the uttermost those who draw near to God through him, since he always lives to make intercession for them. 26 For it was indeed fitting that we should have such a high priest, holy, innocent, unstained, separated from sinners, and exalted above the heavens. 27 He has no need, like those high priests, to offer sacrifices daily, first for his own sins and then for those of the people, since he did this once for all when he offered up himself.
So as to the original question, “When we are praying do we pray directly to God or through Jesus?” Again, the answer is yes, we pray directly to God the Father because that is what Jesus taught us to do, and yes we pray through Jesus because He is our high priest who has given us direct access to God the Father by His sacrifice and He is now interceding on our behalf before the Father. So when it comes to praying, Hebrews 4:14-15 says it best:
14 Since then we have a great high priest who has passed through the heavens, Jesus, the Son of God, let us hold fast our confession. 15 For we do not have a high priest who is unable to sympathize with our weaknesses, but one who in every respect has been tempted as we are, yet without sin. 16 Let us then with confidence draw near to the throne of grace, that we may receive mercy and find grace to help in time of need.
As Christians, we pray to God our Father because He is the provider of all good things (James 1:17; Matthew 7:7-11), and we pray in Jesus’ name because He is the one who makes it possible to approach God because His blood has covered our sins.