When you write the pin to output a 0 or a 1, you are switching a mosfet for that pin, this mosfet has a resistance, and it does vary with temperature and voltage.
If you look on the datasheet it will tell you the maximum current per pin, and maximum per device, sometimes they even tell you the driver resistance, still, never exceed those maximum's, and you should be in the right ballpark for what the pins can safely source or sink.