If this is a valid example of the concept, it's a bit earlier than the ones that have been mentioned so far.
1950: "To the Stars", a novel by L. Ron Hubbard; first published as a two-part serial in Astounding Science Fiction, February 1950 and Astounding Science Fiction, March 1950, available at the Internet Archive (part 1, part 2); published in book form as Return to Tomorrow and also under the original title.
The Hound of Heaven is a slower-than-light interstellar freighter whose crew, cut off from planetbound society by relativistic time dilation, endlessly ply the space lanes from star to star with loads of ore and gems and trade goods.
Wikipedia plot summary:
Protagonist Alan Corday is a young engineer, and is kidnapped from a spaceport called "New Chicago" and taken aboard the interstellar trading starship Hound of Heaven. The ship is commanded by a charismatic leader named Captain Jocelyn, who tells Corday to use his skills to help the Hound of Heaven in its travels between Earth and space colonies in other star systems. On the first page of the book's prologue Hubbard cites "the basic equation of mass and time.... AS MASS APPROACHES INFINITY, TIME APPROACHES ZERO", meaning that interstellar travelers at near light speed experience time relative to their environment, and when they return to their home star will find that decades or centuries may have passed. Six weeks of time aboard the ship amounts to roughly nine years experienced by those on Earth. Corday resists mingling with the culture aboard the starship, but when he returns home after travels with the Hound of Heaven he finds that his fiancee has aged and has trouble with her memory. Corday realizes his only home has become that of the starship. Captain Jocelyn is killed in an ambush on a dystopian Earth, and Corday takes command of the ship.