There are a few general rules of thumb for getting the right height of a table lamp:
Table height: Keep the table lamp no taller than half the height of the table. For example, if your table is 100cm tall, make sure the lamp is no taller than 50cm.
Sitting height: Having the table lamp just above eye level when sitting down ensures proper illumination, especially for work surfaces like desks.
Room size: If the room is small, you may want to avoid using very tall table lamps to avoid making the room feel even smaller. And if the room is big, you may want to consider getting a large lamp to fill in space and ensure the room is lit up well.
If you need some help, here are some useful guidelines for table lamp heights
For end tables: 61-81 tall
For nightstands: 51cm-71cm tall
For console tables: 76cm-91 inches tall