The train from Locust Valley to New York City is approximately 1 hour and 15 min. However, that depends on what time of day you are traveling. Some people take the train directly from Locust Valley and other prefer to drive to either Manhasset or Syosset and get an express train to the City.
Whichever you choose, the train is a great asset. I have taken the train, directly out of the Locust Valley station, to Jamaica station and got on the "Train to the Plane" subway to JFK airport and was on the beach in Sarasota Florida in less than 4 hours!!!