The Rambam (Maimonides) in Mishneh Torah, Hilchot Teshuva describes what is necessary for asking and granting forgiveness. But before we get to forgiveness we have to talk about teshuva, repentance.
Teshuva, according to the Rambam, requires the following elements:
That you regret the transgression and confess it verbally before God. (For sins against man, as opposed to sins against God, it is praiseworthy but not required to confess in public.)
That you make amends to those you wronged and seek their forgiveness.
That you resolve to change your ways.
Now, on asking for forgiveness, here's what the Rambam says:
Even if a person only upset a colleague by saying [certain] things, he must appease him and approach him [repeatedly] until he forgives him.
If his colleague does not desire to forgive him, he should bring a group of three of his friends and approach him with them and request [forgiveness]. If [the wronged party] is not appeased, he should repeat the process a second and third time. If he [still] does not want [to forgive him], he may let him alone and need not pursue [the matter further]. On the contrary, the person who refuses to grant forgiveness is the one considered as the sinner.
[...] It is forbidden for a person to be cruel and refuse to be appeased. Rather, he should be easily pacified, but hard to anger. When the person who wronged him asks for forgiveness, he should forgive him with a complete heart and a willing spirit. Even if he aggravated and wronged him severely, he should not seek revenge or bear a grudge.
As you can see, the focus here is on actions, which others can see, more than on intentions, which are known only to the individual and to God. When somebody comes to you to ask forgiveness, how do you know if he's sincere? You don't. But you know whether he has made amends (like paying for property he damaged), and you know that he has asked, in front of others, up to three times. And even if he didn't, you should grant the request for forgiveness.
So what about when the person doesn't ask for forgiveness? You're allowed to forgive anyway, and in fact the Yom Kippur liturgy includes a sort of "mutual forgiveness clause" to cover both people who knowingly wronged you and didn't ask and those who didn't even know (so how could they ask?). Naturally, you may only give forgiveness that is yours to give -- you can forgive people who wronged you, but it's not your place to forgive people who wronged others. If the wronged party has died, then the matter is now between the transgressor and God.