When I check for update in macOS, are the software from other sources checked for updates as well? So far as my experience goes, some software are available directly from  Mac App Store, others are installed from other source e.g. gimp for Mac.

When I check for updates in Mac, does it check for updates for the second category as well?

If the answer is no, how do I know whether a new version for gimp has been released?
The Mac App Store will only check for updates for system applications or those installed from the Mac App Store.

Though I have not used Gimp in particular, most apps distributed outside of the Mac App Store will have an option in the menu bar under either the app name or help menus. That option will usually be titled something along the lines of Check for Updates.

You can download the latest version of Gimp here: Gimp - Downloads.