This is based on dating for many years before meeting my wife, both people I met offline and online (although not via Tinder, that came after my dating days). Further I will assume that your date isn't your type, but is otherwise inoffensive. If your date turns out to be impolite, creepy, aggressive, or otherwise not behaving appropriately, you have every right to leave at any point.
What is the polite way to immediately end a date and say goodbye if I know that there are no future prospects?
In a nutshell, you can't. Ending a date this early is rude, and no amount of sugar coating will change this. If you are going for politeness, making up a semi-plausible excuse (like the cliché "have a friend call you") is probably the most non-rude way you can go (you need to decide for yourself if shaving off 50 minutes of a date that isn't going anywhere would be worth this for you, it certainly wouldn't have been for me).
But isn't it more efficient for everybody if you let them know immediately that you don't see this going anywhere?
Sure, but a deeply human activity such as dating isn't only about efficiency. How would you feel if your date came in, took a look at you, and left after exchanging 20 words? It's difficult for me to envision anybody who would not feel devalued as a person by this experience. Always keep in mind that your date is a person, too. I get that you feel like you would have rather spent this hour differently (and I too had a few such dates), but it's not worth it to, at least likely, hurt the feelings of the other person.
So how long should I stay?
About as long as the activity you agreed on normally takes. If you meet for coffee or for a drink in a bar, stay at least half an hour to an hour. If you meet for dinner, don't leave before your date has finished their meal. If you go to the cinema, you should stay at least until the movie has finished. Basically, don't make it (too) obvious that you would rather get the heck out of there than spend anymore time with your date.