I tested this in Ubuntu 24.04 and Mahjong.
You need to create two files. First is a bash script that will start the timer and call Mahjong. Second is the desktop launcher that will allow you to create a shortcut of the game Mahjong so that it starts with the script rather than directly.
1. The Script
This script uses zenity. Zenity is installed by default in Ubuntu 24.04. if it is not installed, use the command:
sudo apt install zenity
The script assumes your computer has the deb version of mahjong installed. If you have the snap version, the script won't not work.
Copy and paste the script below in the bin folder of the user's home with the name /home/username/bin/my_mahjongg, where username is your or your parent's user name.
#!/bin/bash
# Date: Oct 4, 2024
# Purpose: A wrapper script to show a pop up at an interval while playing Mahjongg
If the Mahjongg.desktop does not exist, create it based on the default launcher
then delete lines with local languages and replace the name of the executable with
the name of this script
if [[ ! -f $HOME/.local/share/applications/Mahjongg.desktop ]]; then
echo personlized launcher file does not exit, creting one...
cp /usr/share/applications/org.gnome.Mahjongg.desktop $HOME/.local/share/applications/Mahjongg.desktop
sed -i -e /"["/d -e s,Exec=gnome-mahjongg,Exec="$HOME/bin/""$(basename "$0")",g -e s/"Name=Mahjongg"/"Name=My Mahjongg"/g $HOME/.local/share/applications/Mahjongg.desktop
sed -i '1s/^/[Desktop Entry]\n/' $HOME/.local/share/applications/Mahjongg.desktop
fi
End of launcher file createion
SECONDS=0 # Initializing builtin seconds counter
pop_sec=300 # First pop up in seconds (1 hr = 3600 sec)
pop_sec2=$((pop_sec/2)) # Subsequent pop up in half the time of first pop up
(/usr/games/gnome-mahjongg &) # Starting Mahjongg
while (pidof gnome-mahjongg >/dev/null 2>&1) # While Mahjongg is running
do
if [[ $SECONDS -ge $pop_sec ]]; then # check if it is time for a reminder
hr_min=$(printf '%dh:%dm\n' $((SECONDS/3600)) $((SECONDS%3600/60)))
zenity
--info
--text="<span size="xx-large">You have played Mahjongg for $hr_min.</span>\n\nIt is time for a <b>break</b>. Close the game now.\n\n If you don't stop, I will remind again in $((pop_sec2/60)) minutes"
--title="Reminder"
--ok-label="OK, I will stop now!"
--timeout=30
pop_sec=$((SECONDS+pop_sec2))
fi
sleep 30s # wait time before checking again if Mahjongg is running
done
Modify the script
The script a variable pop_sec=300 This is the number of seconds the script will run before the first reminder pop up. I have set 300 seconds = 5 minutes for testing. You may want to set it to 3600, that is, 1 hour. Subsequent reminders will pop up half the time of the initial reminder.
Enable logging
Add the following line at the bottom of the script if you want to log the time you spend on each session of Mahjong.
echo "Mahjong was open for $(printf '%dh:%dm\n' $((SECONDS/3600)) $((SECONDS%3600/60))) on $(date)" >> $HOME/My_Mahjongg.log
This of code line will add a line to the log file My_Mahjongg.log in the user's home folder every time Majongg is played. An example:
Mahjong was open for 1h:23m on Sat Oct 5 09:35:30 AM EDT 2024
Make the script executable
A script needs to be executable before you can run it.
Either
right click on the script and select Properties. In the next window, turn on the switch Executable as a program
Or
use the command:
chmod +x bin/my_mahjongg
You don't have to do both.
Try the script
Now you can start the script from the terminal by entering:
my_mahjongg
This will start the script in the background and open Mahjong. After one hour a reminder window will pop up.

You will be able to dismiss the window by clicking on the OK button at the bottom of the window. Clicking this button won't close Mahjong. If you don't click the button the reminder will close it self in 30 seconds.
If you close Mahjong, the script will exit. If you continue to play the reminder will pop up again in half an hour.
First run creates a desktop launcher
The first time you run the script, it will look for a corresponding desktop launcher file /home/username/.local/share/applications/Mahjongg.desktop. If this file does not exist, the script will create this launcher file based on the default Mahjongg desktop launcher.
If all goes well you will see 2 Mahjong icons when you search for the game to play. The first will say "Mahjong". This is the standard one. The second will say "My Mahjong" this will start the script which will start Mahjong.
2. Create a shortcut on Dash
Dash is the vertical bar on the left side of Ubuntu desktop with icons of apps that can be launched. You may want to create a shortcut of "My Mahjong" on the Dash so that you or your parent can start the game by clicking on it.
Search for the app "my Mahjong" and drag and drop in on the dock.

Some Caveats
I have set up the script and the launcher file in one user's personal "Home" folders. The user can change, or remove these files. If each of your parents have separate user accounts, and you want to set it up for all (both) the users, you would keep the files in a different more global location. This will make it harder for the users to remove or modify the files without sudo.
The script is more of a demonstration of a concept rather than a finished product. It works on my computer, but yours may be different. I would like to know if you have any problems with it, but I can't guarantee a fix.
To Do
Currently the timer stops once you close Mahjong. I could save the cumulative play-time for the day in a file and use it in the reminder. For example, if one plays Mahjong for 4 hours in 1 hour sittings each, the script could keep track of that. This will add more complexity to the script.
Hope this helps