There is no exact number of days, but the situation does change how we use it.
In most conversations, "It happened not so long ago," is used to describe something that happened between 1-6 months ago. We would not use it to describe something that happened last week or two weeks ago.
Example:
"I didn't take that class that long ago, but I've already forgotten everything I learned!"
"Oh I went there not so long ago, they have the best cocktails!"
If in regards to a major life event, it can be for a longer period of time. For example, "Her dad died not so long ago. She's still feeling very sad about it." If her dad died a year ago, this "not so long ago" could still be acceptable because we like to give people time to process major life events. Beyond a year, I wouldn't use "not so long ago."