In answering your question, it's good to draw up some clear distinctions:
- There is a difference between Lutherans that hold a quia subscription (because these are true) to the official statements of the Lutheran Church (Book of Concord, etc.) and those who hold to a quatenus (in so far as these are true) subscription. The former grouping actually concludes that the official Lutheran documents are true and binding (because they accurately reflect what God's word says). The latter group has no binding cohesion of truth whatsoever.
- There is a difference between official Lutheran confessions (as contained in the Book of Concord) and unofficial writings written as informal documents.
I mention the previous distinctions for this reason: The previous answer, citing Stark's Gebetbuch is almost worthless in determining official Lutheran doctrine and practice. Stark wrote popular books for leity. He was not writing on behalf of any Lutheran Church body.
How do Lutherans pray for the dead?
The challenge in answering your question is that this is not a question that scripture directly addresses. So wise Christians dare not make commands and prohibitions where God's word hasn't (Deut. 4, etc). For that reason there is not much written by Lutherans on the subject. Luther, for example, in his Great Confession on the Lord's Supper writes:
As for the dead, since Scripture gives us no information on the
subject, I regard it as no sin to pray with free devotion in this or
some similar fashion: “Dear God, if this soul is in a condition
accessible to mercy, be thou gracious to it.” And when this has been
done once or twice, let it suffice. For vigils and requiem masses and
yearly celebrations of requiems are useless, and are merely the
devil’s annual fair.293
(Martin Luther, Word and Sacrament III, ed. Robert H. Fischer, vol. 37
of Luther’s Works. Accordance electronic ed. (Philadelphia: Fortress
Press, 1961), 369.)
Notice Luther's approach: Since scripture is silent, we are free. But notice where he goes directly after this. When our freedom directs us down paths that are against scripture, we no longer are free. In the following words, he writes:
Nor have we anything in Scripture concerning purgatory. It too was
certainly fabricated by goblins. Therefore, I maintain it is not
necessary to believe in it; although all things are possible to God,
and he could very well allow souls to be tormented after their
departure from the body. But he has caused nothing of this to be
spoken or written, therefore he does not wish to have it believed,
either. I know of a purgatory, however, in another way, but it would
not be proper to teach anything about it in the church, nor on the
other hand, to deal with it by means of endowments or vigils.294
Others before me have attacked the invocation of saints, and this
pleases me. I believe, too, that Christ alone should be invoked as our
Mediator, a truth which is scriptural and certain. Of the invocation
of saints nothing is said in Scripture; therefore it is necessarily
uncertain and not to be believed.295
(Martin Luther, Word and Sacrament III, ed. Robert H. Fischer, vol. 37
of Luther’s Works. Accordance electronic ed. (Philadelphia: Fortress
Press, 1961), 369-370.)
Notice, again his approach. In theory, it could be ok to pray for the dead. In practice and in context in Luther's day, this was almost an impossibility because of the unbiblical doctrine of purgatory. We have one mediator for our sins (Jesus). And it is unbiblical to conclude that we need or should pray to those who have gone before us in order to obtain forgiveness.
Luther's approach was then absorbed and included in the Apology:
First, purgatory. Here they “traded” in purgatory, with Masses for the
dead and vigils after seven days, thirty days, and a year,33 and,
finally, with the Common Week,34 All Souls’ Day,35 and Soul Baths,36
so that the Mass is only used on behalf of the dead, although Christ
instituted the sacrament only for the living. Purgatory, therefore,
with all its pomp, requiem Masses, and transactions, is to be regarded
as an apparition of the devil. For it, too, is against the chief
article that Christ alone (and not human works) is to help souls.
Besides, concerning the dead we have received neither command nor
instruction.37 For these reasons, it may be best to abandon it, even
if it were neither error nor idolatry. At this point, the papists cite
Augustine38 and some of the Fathers, who have supposedly written about
purgatory. They suppose that we do not see why and how they use such
passages. St. Augustine does not write that there is a purgatory and
cites no passage of Scripture that persuades him to adopt such a
position. Instead, he leaves it undecided whether there is a purgatory
or not and says simply that his mother asked to be remembered at the
altar, or sacrament.39 Now all of this is nothing but the human
opinions of a few individuals, who can establish no article of faith
(something God alone can do). But our papists employ such human words
in order to make people believe in their shameful, blasphemous,
accursed fairs of Masses offered up into purgatory for the souls of
the dead, etc. They will never prove such a thing from Augustine. When
they have given up their purgatorial “Mass fairs” (something Augustine
never dreamed of), then we will discuss with them whether St.
Augustine’s word, lacking support from Scripture, may be tolerated and
whether the dead may be commemorated at the sacrament. It will not do
to formulate articles of faith on the basis of the holy Fathers’ works
or words. Otherwise, their food, clothes, houses, etc., would also
have to be articles of faith — as has been done with relics. This
means that40 the Word of God — and no one else, not even an angel —
should establish articles of faith.41
(Robert Kolb and Timothy J. Wengert, eds. The Book of Concord: The
Confessions of the Evangelical Lutheran Church. Accordance electronic
ed. (Minneapolis: Fortress Press, 2000), 303-304.)
Melanchton's approach was quite masterful. Instead of approaching the issue from the viewpoint of "do the dead hear our prayers", he approaches it from the viewpoint of, "Why would we want and what need is there for praying to the dead?" As the Apology points out, there is no command in all of scripture to pray to them. But there are commands to pray to Jesus. And right after that the Apology also points out there is no promise in all of scripture that those who have gone before us can hear our prayer. But there is the promise that Jesus can hear our prayers. This is a brilliant and beautiful approach. For it doesn't get us bogged down in areas that God's word does not address (can the dead hear us?). Instead, it puts our faith and salvation on what we can know for certain from scripture.
What does "for" mean?
Finally, we have to tackle then what it means to pray for the dead. That word, "for" is a very flexible on in English usage. It is improper (both within the Bible and within official Lutheran documents) to pray for the dead in such a way that we are giving them an avenue to help forgiveness. That goes against the clear teaching that we have one mediator (Jesus). So also, it goes against the clear teaching that we have "one great high priest" (recurring theme in Hebrews).
But there is another "for" context to consider. It is common for Lutheran churches to pray for the dead in such a way that we pray to our Triune God, thanking our God for those who have gone before us. This is a very common practice, especially on All Saints Day. In that sense, Lutherans do pray for the dead.
As an aside, if you are scared or ashamed to ask your pastor for guidance in God's word, that is an area for concern. If your Lutheran pastor does not know what the official Lutheran documents (book of concord) say about this; or even worse, if he doubts or disagrees with them; or even worse: shames you for asking the question, it would be wise to find a Lutheran Church that honors God's word. And this Stack Exchange is a place to ask questions, but it is an embarrassingly poor place to find personal and pastoral support.