A Cockney accent can mean a few different things... It depends on how specific you're being.
A True Cockney Accent
Technically, a true Cockney accent can only be spoken by a person "born within the sound of Bow bells." This is in reference to the church of St. Mary-le-Bow, and the sound was that of the bells in the church bell tower.
The church itself, as well as the bells, were destroyed a couple of times: once in the Great Fire of London in 1966, and again in bombings during World War II in 1941. The bells finally rang again in 1961 when the church was rebuilt.
The area around St. Mary-le-Bow is no longer residential, so very few people are born within the sound of the bells anymore. It may seem as though very few people would live within the sound of the bells anyway, but it's speculated that the church bells could be heard for about 25 square miles around the church. Since it's right in the midst of the city, this actually did cover a significant portion of the population.
The area that was covered by Bow bells is commonly referred to as the East End of London, and its residents are called East-Enders. There is a very popular British soap opera called EastEnders that has been running continuously since 1985 - and it continues to be one of the highest rated shows on the BBC.
You can hear quite a few examples of a Cockney or East-Ender accent on the program, though you'll hear everything from a thick Cockney accent to a rather posh RP or Standard British accent. Many contemporary London speakers, including some cast members, speak with something call an Estuary accent, which is a blend of Cockney and RP.
Residents of the East End of London may very well speak in a wide variety of accents, as the area has quite a bit of variation in class, income and ethnic origin in its population.
Working-Class London Accents
Other working-class accents in London have the elements of a Cockney accent present in them as well. Michael Caine is often considered a fine (and readily available) example of a Cockney accent, but technically, he's not a Cockney. Michael Caine is from South London.
When he came onto the movie scene in the 1960's, a working-class London accent was rarely heard on screen from a leading man. You could hear it in films like My Fair Lady or Oliver, when the story was about the classic sound and spirit of working-class London, but most contemporary films focused on actors who spoke with an RP accent. Alfie was a huge breakout role for Caine and for the idea that a film focused on a successful-seeming lead with a Cockney accent was something the public would buy - literally.