This question already has an answer here:
Because of the Hubble constant, how far can we now send a signal and still be in range to hear an immediately-issued (the moment they receive a signal) reply? And what percentage of today's visible universe is contained therein (# of galaxies of estimated $2\cdot10^9$ in the visible universe)?
This question is asked due to a paper called Sharpening the Fermi paradox - intergalactic spreading, which informs us how far we (or another civilization) could colonize or police the universe — colonizing any further out is pointless since nothing past this reply-lightcone could reach us with any detrimental effects.
The question is a bit more complex than 'how far can you travel and still return' because of the Hubble expansion of the fraction of galaxies themselves. This is because the density of galaxies (assuming isometric distribution) will be less in the future as well as only being those within your reduced lightcone at the return point.