We know from the beginning of the 2010 movie that Rapunzel is 17 years old. She is on the verge of her 18th birthday.
This isn't revealed in the film, but in the 3rd season of the series, Flynn turns 26. Assuming the series started immediately after the movie, and each season amounts to one year, then Flynn would've been 23 in the film — 5 years older than Rapunzel.
Some people have cited animators as well as writers of Tangled film to place Flynn Rider's age between 24 and 26. That doesn't line up with our math, but what's clear is that he is in his 20s.