A few questions I advise asking yourself before telling someone you have DID/OSDD:
Why do I want to? Do you want to because you think it'll bring you closer? Do you want to because you think they'll think it's cool?
What do I want to get out of telling them? Similar to #1. What sort of response are you hoping for? How realistic is it that you get that response?
How will telling them help me? If they're a roommate or a life partner, it may help to explain erratic behavior or amnesia. If they're someone you barely know or don't really talk to, look to #1 & 2.
How have they reacted to similar news in the past? What are some ways they've talked about trauma/mental illness in the past? Have you told them other "big secrets," and have they reacted well? Are they a gossip? Consider if/how they've talked about others and their secrets.
Do they want this information? Telling someone about a diagnosis such as DID/OSDD can also be a lot for the person receiving the information. This might be something they've never heard of before. It could mean work on their end researching how best to help you. It could be upsetting to find out a friend went through trauma. Consider their emotional well-being as well.
Is there another way to get my needs met? Look at the earlier questions, and identify what need you are trying to meet by telling this person. Is it because you feel frustrated explaining yourself? Is it because you feel you want to be more interesting? Consider other ways you can meet these needs.
Remember that DID/OSDD is a serious and traumagenic mental illness, and that telling someone is a large, serious, vulnerable, and permanent decision. You can't "take back" their knowledge of this. Telling someone about your DID/OSDD who is not an absolutely trusted person could put you at risk of being manipulated/gaslit about your condition, or they could share this with others you didn't consent to knowing, intentionally or unintentionally. Or, on a smaller scale, they could just be annoying/ignorant about it.
Additionally, telling someone could make you feel pressured to "perform." "Performing," in this context, means exaggerating your symptoms (intentionally or unintentionally) to better fit with their idea of your condition, to convince them you're not lying/making things up, or just to seem more interesting. Sometimes this happens without your really noticing or doing it conciously. It could put you at risk of making dissociative barriers worse.
There is no blanket statement I could make to tell you when/if it's safe/in your best interest to tell someone, that's a decision you'll have to make for yourself. These are just questions I ask myself before telling people vulnerable information.