Proverbs 25:17

Withdraw thy foot from thy neighbour’s house; lest he be weary of thee, and so hate thee.

The verse belongs to the collection of Solomon's proverbs gathered by Hezekiah, who lived three hundred years after Solomon.
It teaches restraint in visiting a neighbor's house, withdrawing at times so that frequent presence does not weary the neighbor and turn welcome and affection into resentment, dislike, or hatred.
The command means to make visits infrequent.
The restraint covers both coming too often and staying too long.

The counsel is not directed at those who must rely on others' hospitality, but at thoughtless visiting when a neighbor is busy.
Examples include distracting her from work, keeping a household waiting, or interrupting planned Sabbath-school study and reading.
Visitors should notice their hosts' circumstances and shorten or forgo a visit when it would interfere with their work, comfort, or plans.
Frivolous visits and gossip waste the time of industrious people, and a visitor who brings only boredom should not be surprised when others show they are tired of the visit.

Withdrawing may preserve the relationship, but it does not guarantee that the neighbor will miss the visitor or seek to renew the friendship, since people differ in affection and may not judge others by their own feelings.
The counsel of restraint does not remove the pain of feeling unwelcome.