A crontab line has five time fields (minute, hour, day of month, month, day of week) followed by the command. */5 * * * * means every five minutes. Each user has their own crontab (crontab -e); system-wide jobs live in /etc/cron.d/.
Cron jobs run with a minimal environment: different PATH, no terminal, often a different shell. That is why a script that works by hand fails under cron. Absolute paths and redirecting output to a log file prevent this.
Nextcloud needs a cron job for background tasks, run as the web server user every five minutes. Run as root, it creates files with the wrong owner. systemd timers are an alternative and log straight to the journal.
Example
*/5 * * * * php -f /var/www/nextcloud/cron.php