Archaeological excavations conducted in and around Gdów attest that settlements existed in the area in the Paleolithic, Neolithic and Bronze Ages. From the records of the first permanent settlement was founded in the eleventh century by the wealthy, bearing the coat of arms, who probably also founded the church. The church was reported for the first time in 1272 in a document that is the oldest document discovered to-date referencing Gdów. A major influence on the development of Gdów was its location at the crossroads of trade routes leading to Hungary and Austria, Kraków to and to. Larger development of the settlement was hampered by the Raba river which often burst its banks. Legend has it that in the early fifteenth century King lost his way while heading for castle but was saved by the who pointed him in the correct direction. In 1444 King Władysław in appreciation granted a special dispensation to the church and Mary, and Gdów was transferred to Court Secretary Fihauser. In later years Gdów often changed owners, among them Stanislaw II and Nicholas II, with the last owners in the late seventeenth century being the. granted Gdów the privilege of organizing four fairs each year and a weekly market effectively giving Gdów the status of a city. In 1772 the placed Gdów together with the lands situated on the right bank of the Vistula River under Austrian rule. Later, during the Kraków Uprising, an important battle took place on the outskirts of Gdów and adjacent to the local cemetery. The Battle of Gdów, chronicled by the local priest Ludwik Kusionowicz, took place on February 26, 1846. Austrian troops commanded by General Ludwig von Benedek and peasants from other regions encouraged by Austrian authorities easily defeated the Polish nationalist "insurgents" led by the absent Colonel Suchorzewski. Many were slaughtered in the aftermath of the fighting but a collective grave for 154 of the insurgents killed during the battle was subsequently created in the corner of the cemetery under a mound crowned with an impressive monument. The cemetery also contains the grave of Sylwester Kusionowicz, "nephew" of Ludwik, under a beautiful and evocative statue of the Virgin Mary, created by the master sculptor, which poignantly looks out over the Gdów battlefield.
After Poland regained its independence Gdów became the administrative centre for the local district lying within Wieliczka County.