Your husband asks you if you sent your mortgage payment to the bank. You did, but you want to play a trick on him. You say "Oh no, I totally forgot!" You say the when he starts to look worried.
This is a phrase that you use to show that the last thing you said wasn't true.
People sometimes tell small lies to trick each other, and then say "Just kidding!" to reveal the trick:
A: Can I borrow a piece of paper?
B: That'll be five dollars. Just kidding... here you go.
Kids often use "Just kidding." It's used in casual speech, and not common in writing.