When generating a token through the Generate Token form, the maximum time allowed for a long-lived token is 365 days, as the drop down list in the token generator page goes up to a year:
However, the maximum token expiry is controlled by the lifespan set in ArcGIS Server Manager.
By default, long-lived tokens are set to be valid for 1 day in ArcGIS Server Manager. If you generate a token through the token generator (accessed over http://<ArcGIS Server machine name>/arcgis/tokens) and specify a time period longer than 1 day, your token will expire after 1 day.
If you need to generate a token for up to a year, remember to set the desired lifespan value first through ArcGIS Server Manager first before you generate your token through the token generator.