You should tell those who need to know, such as healthcare providers, your spouse or significant others, and people who are involved in your recuperative care.
You need not feel you have to explain your surgery to everyone who asks. Those who are just curious need to know only that you had abdominal surgery, or that you had part or all of your colon or bladder removed.
If you are considering marriage, thorough discussions with your future spouse about life with an ostomy and its affect on sex, children, and family acceptance will help alleviate misconceptions and fear on the part of the spouse.
If you have children, answer their questions simply and truthfully. A simple explanation will be enough for them. You may want to confide in your employer or a good friend at work because keeping it a complete secret may cause practical difficulties.