If you're going to try this approach out, you might want to consider using a clear, transparent plastic bag, as that will be a bit more effective than a black contractor bag. They do make clear contractor bags.
I have only ever read up on solarizing garden plots, so I don't know specifics about potting soil. In garden plots, you want to use transparent sheets of plastic, choose the hottest and sunniest time of year, and leave that down for at least a month or two.
For a small amount of potting soil, I assume it wouldn't take quite as long, but you'd likely want to do this in the summer, place it in direct sunlight for as many hours as possible and leave it there for as many days as possible. I would also suggest breaking up the soil as much as you can and spreading it out as thinly as you can.
Another option might be to compost the potting soil. This is the approach I use, but it does of course require a bit of space and a lot more time. The quick and easy way is to sterilize the soil in an oven if that's an option for you.