"Ad" is short for "advertisement". It has one D because the longer word does.
"Add" is a verb meaning to calculate the sum of two numbers, or to put things together. It has two D's because... well, I don't know why, but that's the way it's spelled.
They are NOT interchangeable. If you use one when you mean the other, it makes you look STUPID. Here's a mnemonic for you. You have to add an extra D to get "add".
Thank you for your cooperation.