You can apply for a UK visa maximum 3 months before the date of traveling to the country. This rule applies to all kinds of UK visit visa types.