This is heavily dependent on your region, country, and airline. Some commenters immediately answer like you were in the US but those might not be valid for you.
You must checkin no later than 45minutes before your flight. It’s a TSA requirement so they can confirm the manifest
I’m guessing that’s a USA-only rule.
The TSA doesn’t have much authority over other countries
It’s all there in the name: the Transportation States of America
It’s a good idea to avoid being bumped out of a flight because they ended up overbooked
It’s use is limited for some situations. Especially when you don’t only have carry-on, some places still require you to stand in line for checkin. Then you barely have a benefit doing an online checkin.
However, more modern airports/airlines have automated the checkin process, even offer tags to print at home and automated bag drop areas.
For these situations it’s pretty good to check in online and just walk past the lines.