The frame= key of the listings package always typesets the frame with respect to the current line width. Hence, I suggest to use another command or environment to draw the frame.
A basic solution (without further packages) would be to render the listing inside an \fbox, which, however, as a macro does not accept verbatim material as argument. So the listing has to by typesetted in an lrbox first.
Alternatively, some framing environment may be used (in the example below I use adjustbox, but you literally have dozens of possibilities here), which would not require the detour over an lrbox.
Finally (not presented below) you my define your own PASCAL environment with \lstnewenvironment{PASCAL}{<begin code>}{<end code>} (see listings documentation) that combines either method with the listings environment to gain maximum comfort.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{listings}
\usepackage{adjustbox} % For Option 2 only
\begin{document}
\lstset{numbers=left, numberstyle=\small, numbersep=8pt, language=Pascal}
% Option 1: Typeset in an LR-box and use \fbox{} to draw the frame
\newsavebox{\Lst}
\begin{lrbox}{\Lst}
\begin{lstlisting}
PROGRAM afficher_bonjour;
BEGIN WRITE('Bonjour');
END.
\end{lstlisting}
\end{lrbox}
% draw frame an Listing. The \hskip enlarges the box to have numbers within the frame
\noindent\fbox{\hskip15pt\usebox{\Lst}}
% Option 2: Use some framing environment. There are lots of possibilities!
% I have just use adjustbox, which is a kind of swiss army knife for boxing
\begin{adjustbox}{padding=15pt 0pt 0pt 0pt, fbox}
\begin{lstlisting}
PROGRAM afficher_bonjour;
BEGIN WRITE('Bonjour');
END.
\end{lstlisting}
\end{adjustbox}
\end{document}
