That's actually the specific case in which there really is a duplicate content penalty. Having multiple pages on your website that have the same content but different page names was a very old seo trick. Basically to target many keywords a webmaster would create a series of identical pages each with a different page name so as to target individual keywords.
Because of that abuse the search engines started penalizing a site if they find to many duplicate pages. It's viewed in a similar manner as keyword stuffing.
Over the years though, especially with generated pages that many websites can end up with multiple urls all pointing to the same page. That's why google tools has a selection to choose whether you want the www or non-www page to be the prefered usage. The search engines are actually smart enough to figure that out, but it's still often recommended to even redirect one to the other just to make sure a page doesn't show as a duplicate in even that case.
Because there are many scripts that can cause a single page to have multiple urls, google has established a canonical tag that you can use to let the search engine know which is the actual url you want for any particular pages.
Unless you're intentionally creating multiple duplicate pages to target different keywords, you most likely won't actually get a penalty over it though. What will happen is google will try to determine which is the best page to index. If you don't help it by using redirects or canonical tags then it may not choose the actual page that you would want it to. It can also cause you to loose link juice because rather than one page seen as getting x number of links to it, google will see 2 pages each getting half as many links, so neither page does as well as the single page might have.
Do a search on google for "canonical tag" and "duplicate content" and "duplicate content penalty" on webmaster tools and you'll find a few videos from Matt Cutts discussing the topic.