Go through these in order and stop at the first one that applies. If you are reading this for someone else, answer for them.
Seek emergency care now if the bump or swelling comes with:
These symptoms may point to a problem affecting the eye socket or the eye itself rather than only the eyelid.
Arrange same-day medical care if redness or swelling is spreading around the eye, you have a fever, you feel significantly unwell, or swelling prevents you from opening the eye.
Infection around the eyelid sometimes needs prompt treatment.
Book a routine appointment if the bump lasts several weeks, keeps growing, returns in the same place, or interferes with vision.
It should also be checked if it bleeds, forms a persistent sore, causes eyelashes to fall out, or changes the eyelid’s shape.
The article also says
Earlier assessment may be appropriate if you have a weakened immune system or have recently had eye surgery or an eye injury.
Every sign above is quoted from the sofidex article on Eyelid bump. If you are not sure, err upward — it is always reasonable to be checked.