If you keep the sour cream refrigerated which you should do then the sealed container of sour cream should last 2 to 4 weeks past the use by or sell by date.
You can freeze the sour cream if you want to keep it longer than a few weeks to a month but I would not recommend freezing the sour cream because if you do it won't have as good of taste or texture once it thaws out.
I would recommend eating the sour cream within a few weeks to a month of buying the sour cream and if you open the container of sour cream it should last a week or two weeks before going bad.
If you notice the sour cream has a bad smell to it or the sour cream has mold on it then throw out the sour cream and don't risk getting sick.
Always refrigerate the sour cream within a few hours of using it to keep it fresh and prevent it from going bad.