To nitpick as we do, they actually took place over two years: ST II&III were in 2285, and STIV&V were in 2286.
But that's besides the point. It wasn't originally planned to have the four movies be sequential. Leonard Nimoy once noted in his autobiography "I Am Spock" (which is brilliant, by the way) that he wasn't even aware of the coffin landing on the Genesis Planet until he was watching Wrath of Khan in the theater.
Storywise, it made sense for III to be an immediate follow-on to II, as they needed to resolve the resurrection of Spock storyline. As for IV, they needed to give Starfleet a reason to keep Kirk in service after he stole a starship (and blew it up) AND give him a new Enterprise to command. Ergo, planetary crisis.
Star Trek V is considered to be its own entity (in fact, Star Trek II-IV have been resold as the "Star Trek Motion Picture Trilogy"). It wasn't an immediate follow-on to IV, as Scotty noted they'd already taken the Enterprise-A on its shakedown cruise, and the thing practically fell out from under them.