When it is asked what do 'the lines' mean we need to look at the literary structure of the song but also the wider context. For 'cups' and 'lines' often carry metaphoric meanings, as do so many other words in the Bible.
This particular Psalm must be treated with 'extra metaphorical significance' with respect to its historical context because it was evidently applied to the Messiah both before Christ in ancient rabbinic literature and after his resurrection in the New Testament. Therefore, to be honest to the intent of the original author -- everything in it has imagery that indicates a future tense. (i.e, David's reflections were intended as prophetic.) The future drift of the reflection is clearly seen in David's conclusion that being satisfied in the Lord actually meant his body will not see decay.
From a simple analysis on the meaning of the phrase in v6, Burg spells it clearly:
The lines, that is, the cords with which they used to measure their lands in surveys; and hence the allotted portion. Compare Amos, 7:17; Zech. 2:5; 2 Sam. 8:2. For נָפַל, with ל, in the signification of To happen, see Num. 34:2; Judg. 18:1. (A COMMENTARY onTHE BOOK OF PSALMS; WILLIAM DE BURGH, D. D)
Alfred Edersheim (the Jewish historian) helps by recording an ancient rabbinical reference that indicates the 'lines' measured out as the 'cup' that David accepts as his portion, which in turn brings comfort to cups of blessing appointed in the days of the 'cups' of judgment from the Messiah.
Ps. 16:5 is discussed in Ber. R. 88, in connection with the cup which Pharaoh’s butler saw in his dream. From this the Midrash proceeds to speak of the four cups appointed for the Passover night, and to explain their meaning in various manners, among others, contrasting the four cups of fury, which God would make the nations drink, with the four cups of salvation which He would give Israel in the latter days, viz. Ps. 16:5; Ps. 116:13; Ps. 23:5. The expression, Ps. 116:13, rendered in our A. V. ‘the cup of salvation,’ is in the original, ‘the cup of salvations’—and is explained as implying one for the days of the Messiah, and the other for the days of Gog. (Alfred Edersheim Life and Times of Jesus Appendix 9)
Looking at David's 'satisfaction' as a 'prophetic reflection' we easily note that Christ was satisfied with his 'cup' or 'portion' above any man ever was. He even symbolically drank its bitter taste in joy on the cross, while literally drinking it also in death. (Matt 20:22, 26:27, 26:39, John 19:29) By the 'Suffering One' who was content with his portion from the Father, he granted David that prophetic confidence in his own resurrection.
Bonar captures the prophetic imagery concept well:
this Psalm exhibits One who is happy, truly happy, notwithstanding a world of broken cisterns around him, and the sighs borne to his ear on every breeze. This happy One is “he Man of Sorrows,”—no other than He! For Peter, in Acts 2:31, declares, “David speaketh concerning Him!” This happy One (followed in all ages by his chosen ones) walks through many a varied scene, and at every step expresses satisfaction and perfect contentment with the Father’s arrangements. In verses 1, 2, he tells, with complacent delight, into whose hands it is he has committed his all: “Thou art my Lord,”—my soul has said this with all its strength...Nor less remarkable is it to hear, in ver. 6, the Man of Sorrows tell that his lines have fallen to him in pleasant places! He that had nowhere to lay his head, how happy is He! What a calm contentment sits upon his pensive brow! Earth and hell are unable to destroy his blessed lot. (CHRIST AND HIS CHURCH in the BOOK OF PSALMS, ANDREW A. Bonar)
Hence 'the lines' in the original prophetic sense is the 'portion or cup' that Christ was given by the father in order that our bodies will not see decay as members of his:
Therefore my heart is glad and my tongue rejoices; my body also will rest secure, because you will not abandon me to the realm of the dead,
nor will you let your faithful one see decay.
You make known to me the path of life; you will fill me with joy in your presence, with eternal pleasures at your right hand. (Psalms 16:9-11, NIV)