\documentclass[a4paper]{article}
\makeatletter
\newif\iffirstsection \firstsectiontrue
\let\@partOLD\@part
\renewcommand{\@part}[2][]{\clearpage\@partOLD[#1]{#2}\firstsectiontrue}
\let\@spartOLD\@spart
\renewcommand{\@spart}[1]{\clearpage\@spartOLD{#1}\firstsectiontrue}
\renewcommand{\section}{%
\iffirstsection\firstsectionfalse\else\clearpage\fi%
\@startsection {section}{1}%
{\z@}{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}{\reset@font\Large\bfseries}}
\@addtoreset{section}{part}
\makeatother
\begin{document}
\title{Test of some code}
\author{You and Me}
\date{\today}
\maketitle
\begin{abstract} Testing some code about parts and sections. \end{abstract}
\tableofcontents
\part{Title of the first part}
\section{Title of the first section in the first part}
This section goes in the same page as the part title.
\section{Title of the second section in the first part}
This section goes in a new page.
\section{Title of the third section in the first part}
This section goes in a new page.
\part{Title of the second part}
\section{Title of the first section in the second part}
This section goes in the same page as the part title.
\section{Title of the second section in the second part}
This section goes in a new page.