Format an integer with thousands separator (recursive implementation)
ArtemyVysotsky has provided you with a improved solution, so I am just going to give some general advice:


Do not use using namespace std; since it not only lowers readability of your code (things that belong to the standard library are no longer easily discernible) but also opens the door for subtle name resolution bugs.
n is of type long long, but mod is only of type int. Since mod grows until n % mod == n, you are running into the risk of overflow here, so mod should also be of type long long. However, since mod should never be negative, it would be even better to have it be a unsigned long long/
Keep your spacing consistent. For example, why do you sometimes leave space around == and other times don't? There is no right coding style that everyone agrees on, so you are free do choose any option that fits you, but you should at the very least stick to the style you choose throughout your code (also, keep in mind that most programmers consider more space better than less space, so leaving a space around operators is generally better received than not doing so).
Consider wrapping your recursive function in a helper function. Anyone who doesn't know about your code would assume that all three parameters your function takes can and should be passed by the caller when the last two arguments aren't actually supposed to take anything but their default value. 
Don't treat single characters as strings when treating them as chars would work fine. In particular, prefer std::cout &lt;&lt; ... &lt;&lt; ','; over std::cout &lt;&lt; ... &lt;&lt; "," since this is (likely to be) faster and more efficient.
Having a function output do std::cout directly severely harms its uses. For example, what if I want to send the formatted number to a file? Currently, your function doesn't help much with that. There are several possible improvements here, for example building and returning a std::string or taking an std::ostream as a parameter and output to that instead.
You don't actually need return 0; in main, the compiler is nice enough to add that automatically (Beware, however, as this only happens in main!).