Templates are not just image dimensions, they also include image type and precision, color handling and default layer.
But the template is only used when you create the image, the image doesn't remember it comes from a given template and you cannot assign a new template to it.
If you want a new template, a possible solution is to start a new image with the required template, and copy elements from the old image. Two ways:
- Save the old image as XCF, and in the new image use
File>Open as layers to load it (this only loads layers, and not channels or paths).
- With the two images opened in Gimp, drag/drop from the Layers/Channels/Paths dialog of the old image to the canvas of the new image. But doing so loses the actual positions of the layers (and the channels are copied as layers and have to be converted to channels).
So in lost cases you are likely much better off using
Image>Canvas size to increase your canvas dimensions.