When a photograph is in the public domain, it means that there is no copyright, and anyone may use, copy or distribute the photo for any purpose. There is nothing about posting photos online that inherently places them in the public domain.
You own the copyright to photos you take from the moment you take them. When you post them online through a third party website or social media platform, you agree to the terms of service of that website. Many major image-sharing websites have terms of service stating that you continue to own the copyright to photos you post, but you grant the website a license to copy or distribute them. This may be sublicensable, so that the service can give others permission to reblog, retweet, or otherwise share the photos. Other websites, such as Unsplash and Pixabay, are set up specifically for photographers who want to release their photos into the public domain. Therefore, by posting on these sites, you do agree to terms of service that place your photos in the public domain.
In addition, photos enter the public domain when the copyright term expires. For photos taken after January 1, 1978, the copyright term is the life of the author plus 70 years.