The interactive toplevel can be stopped in two ways: enter the system end-of-file character (typically Control-D) or by executing the halt/0 predicate:
?- halt. $