We like reproducible examples here on Stack Overflow. Otherwise we're just guessing.
I'll guess that you are using kmeans in the stats package.
I'll further guess you haven't read the documentation help(kmeans) which says:
Value:
an object of class 'kmeans' which is a list with components:
cluster: A vector of integers indicating the cluster to which each point is allocated.
There's an example in the help that shows you exactly how that works.