To be honest, without perfect divine knowledge from the Norse God of Statistics, there isn't a way to know with 100% certainty just how many clusters your original data may have had from a sample alone. However, because this answer seems like a cop-out, here is an educated opinion:
There are two options that quickly spring to my mind:
If you have a guess for a range of clusters you expect, then you can repeatedly apply $k$-means clustering to minimise some form of cross-validated error rate (if you have a gold standard data set or a training set you trust).
However, if you are performing exploratory data analysis and have no idea how many clusters you may have, I would read about Agglomerative and Divisive Hierarchical Clustering. Here is a data mining lecture that discusses these options with a little more detail:
As pointed out in the comments, there is "no such thing as $k$-nearest neighbours clustering", so I have corrected my statement. To better better see the difference between $k$-means (clustering) and $k$-nearest neighbours (classification), see this Quora discussion.