How many light years away is the constellation cancer?
In the zonal-direction of Cancer, seen in the nights of June-July, there are quite many far and near stars. The nearest is DX Cnc, at 12 ly and the farthest is HD 67542, at 1392 ly..
Reference: Data in the answer are from wiki pages on Constellation Cancer.
I like to add the following.
The broad separation of the star-world around, into constellations, is a matter of convenience, Common people are familiar with the 12 zodiacs, against 12 months.
Like seeing around, from a merry-go-round, we transit (in the night sky) from one constellation to another every month, The transit is from Gemini to Cancer in June and from Cancer to Leo in July.
In a conical angle embracing a constellation, the near-and-far limits for any constellation are virtual, As the cone widens with distance, there are more, like galaxies and clusters, that are named with new codes. Only for reference to direction, the names of nearer configuration of stars are used.