You know you're in confession if:
- you started your conversation saying bless me father for I have sinned.
- the priest dons his purple stole
- you can't see the priest you're talking to
- you stood in line to talk to a priest
- you were given absolution for your sins
- you end your conversation by making an act of contrition.
- you don't go in to details, but merely count the number of times you screwed up.
- when you knelt down a light changed from green to red.
The most relaxed (and personally awful) confession I ever did was in the middle of a conversation. The priest merely whipped out his stole, told me that if I wanted more grace I should kneel and I told him all the awful things I was probably going to tell him anyway.
Let me know if you want a more canon law answer, rather than an anecdotal one. I don't think there's any mistaking when you're in confession, the most telling part is the absolution, but if you don't get absolution for whatever reason, I doubt you didn't know you went to confession.
The normal for of confession, according to the handbook of prayers (which is not a liturgical text, but a guide for the laity) is that confession begins with "bless me father... And it's been x number of days since my last confession" then you rattle off your calumnities and the priest gives you a little advice and asks if you're really sorry (you say yes, I don't want to know what happens if you say no, always say yes). Then the priest (acting in persona Christi) absolves you of your sins and you say an Act of Contrition (O my God I am heartily sorry, etc...) and the priest gives you some penance (usually a number of prayers to be prayed in earnest nowadays, although in the past, the punishement fit the crime) the most penance I've ever had was flowers and a date night. Then you leave feeling refreshed in body and soul. (Unless you did something dumb or self righteous in the confessional, then you feel worse than you can possibly imagine. But it's not so bad, you remind yourself, same absolution same succor of Heaven.