Do I have to pay capital gains even though it was bought out and I still have the money in my robin hood account?

I was hoping I could pay capital gains when I purchase at a later date. I didn't want to sell my shares.