Yes, it is okay to drink coffee in the afternoon, but it is recommended to avoid it after 4 pm, especially if you are sensitive to caffeine and want to sleep well at night.