The culprit here is not \textwidth, it is your factor 0.5 which results in an total length for both images as 0.5\textwidth+ separator length + 0.5\textwidth > \textwidth. That results in your overful box.
Just play with the factor, use for example 0.485 as shown in the following mwe (I added package showframe to visualize typing area and margins):
\documentclass[twocolumn]{article}
\usepackage{subfig}
\usepackage{graphicx}
\usepackage{showframe} % <============= to visiualize typing area and margins
\begin{document}
\begin{figure*}
\centering
\subfloat %[] if you want labeled subfigures.
{%
\includegraphics[width=0.485\textwidth]{example-image-a}
}%
\subfloat
{%
\includegraphics[width=0.485\textwidth]{example-image-b}
}%
\caption{Your caption here}
\end{figure*}
\end{document}
and the result:

BTW: Because you are using environment figure* you can use \textwidth, because figure* spans both columns. If you use figure your figure is placed in one column and you should use \columnwidth. Please see the expanded mwe
\documentclass[twocolumn]{article}
\usepackage{subfig}
\usepackage{graphicx}
\usepackage{showframe} % <============= to visiualize typing area and margins
\usepackage{blindtext}
\begin{document}
\begin{figure*}
\centering
\subfloat %[] if you want labeled subfigures.
{%
\includegraphics[width=0.485\textwidth]{example-image-a}
}%
\subfloat
{%
\includegraphics[width=0.485\textwidth]{example-image-b}
}%
\caption{Your caption here}
\end{figure*}
\Blindtext
\begin{figure}[!hb]
\includegraphics[width=\columnwidth]{example-image-c}
\end{figure}
\Blindtext
\end{document}
and the result:

.24or.485. – Gus Jun 30 '19 at 00:11hfillor not) and at last on the used images and their sizes ... That makes it not easy or propably impossible to find a formula to handle this in an automatic way ... – Mensch Jun 30 '19 at 17:27