Type IV pili (Tfp) are prokaryotic retractable appendages known to mediate surface attachment, motility, and subsequent clustering of cells. Tfp are the main means of motility for Neisseria gonorrhoeae, the causative agent of gonorrhea. Tfp are also involved in formation of the microcolonies, which play a crucial role in the progression of the disease. While motility of individual cells is relatively well understood, little is known about the dynamics of N. gonorrhoeae aggregation. We investigate how individual N. gonorrhoeae cells, initially uniformly dispersed on flat plastic or glass surfaces, agglomerate into spherical microcolonies within hours. We quantify the clustering process by measuring the area fraction covered by the cells, number of cell aggregates, and their average size as a function of time. We observe that the microcolonies are also able to move but their mobility rapidly vanishes as the size of the colony increases. After a certain critical size they become immobile. We propose a simple theoretical model which assumes a pili-pili interaction of cells as the main clustering mechanism. Numerical simulations of the model quantitatively reproduce the experimental data on clustering and thus suggest that the agglomeration process can be entirely explained by the Tfp-mediated interactions. In agreement with this hypothesis mutants lacking pili are not able to form colonies. Moreover, cells with deficient quorum sensing mechanism show similar aggregation as the wild-type bacteria. Therefore, our results demonstrate that pili provide an essential mechanism for colony formation, while additional chemical cues, for example quorum sensing, might be of secondary importance.