Potato plants often flower, but not always and I don't know what makes the difference. But they can make potatoes either way. But Butterfly lady is right. The signal that your potatoes are ready to harvest is that the plant turns yellow and withers up and dies.
But my experience with growing potatoes in trash cans is that I never could get potatoes much bigger than golf balls. I have seen other people say the same thing, but some people swear that they can grow full sized potatoes that way. I'm thinking there's a couple of tips - don't fill your trash can with soil too fast. The leaves are what collects energy for the tuber. If you keep burying leaves, you cut down on tubers. You have to leave it plenty of leaves. Second is that I think I wasn't fertilizing mine enough.