Tom Hanks's character, Chuck Noland, was on the island for four years in the movie Cast Away. This duration is confirmed both by the story details in the film and by the character's records on a rock wall, as well as dialogue from Helen Hunt's character in the movie.
In reality, the filming for the island scenes was done in two main phases over about a year. Tom Hanks gained 50 pounds before filming started to portray his pre-island self and then lost the weight and grew his hair and beard during a year-long production break to authentically show the four years spent on the island. The overall filming process, including these breaks and an injury recovery period, lasted sixteen months.
So, the character was stranded for four years in the story, while the actor's filming spanned over a year with strategic pauses to reflect the passage of that time.