The readme.txt file for the original Baldur's Gate confirms that items left in containers remain there indefinitely. (Thanks to Mark for the info, I only have the enhanced edition).
Note that you can still lose items in a container if the area where the container is become inaccessible for any reason. This include one time zones like Irenicus lab in BG2 or zones that are apparently the same map (from player point of view) but are in reality two different zones (from the game point of view) that are swapped after certain events. An example of this is The copper coronet in BG2 before you complete the Free Hendak quest and after that.
Of course, there is also the possibility of bugs doing weird things with your containers. The enhanced edition received a truckload of bug fixes, including some container-messing bugs, but there is a chance that one or two slipped under the radar.
You can find interesting threads about this same question here and here.
Cannot say for sure that the same can be said about Icewind Dale, as I have not played, but since the two games are using the same engine (Infinity Engine), it is very possible that they behave in the same way in this sense.