\renewcommand{\sectionmark}[1]{\markboth{\MakeUppercase{\thesection. #1}}{}}
should do it.
Another suggestion would be to switch to a more flexible class:
\documentclass[emulatestandardclasses,12pt,parskip=full-,
automark,headsepline=2pt,footsepline=1pt,% options to scrlayer-scrpage
]{scrartcl}
\usepackage[table,xcdraw]{xcolor}
\usepackage{listings}
\usepackage{inputenc}% inputenc without option makes not sense with LaTeX from 2018/04/01
\usepackage{graphicx}
\usepackage{polski}
\usepackage[foot=1.25cm,head=\baselineskip, headheight=12pt, marginparsep=2mm ]{geometry}
\usepackage{textcomp}
\usepackage{gensymb}
%\usepackage{parskip}% Don't use it with scrartcl, use class option parskip.
\usepackage{multirow}
\usepackage{tabularx}
\usepackage{enumitem}
\usepackage{booktabs,arydshln}
%\usepackage{array}% Useless, because already loaded by tabularx
\usepackage{caption}
\usepackage{amsmath}
%\usepackage{scrextend}% Not needed, because you are now using a KOMA-Script class.
\usepackage{mwe}
\usepackage[export]{adjustbox}
\usepackage{setspace}
\usepackage{stanli}
\usepackage{tikz}
\usepackage{wrapfig}
% Using scrlayer-scrpage instead of fancyhdr. The package is already loaded,
% because of option "emulatestandardclasses". Otherwise we would use, e.g.,
% \usepackage[automark,headsepline=2pt,footsepline=1pt]{scrlayer-scrpage}
\renewcommand*{\sectionmarkformat}{\thesection.\enskip}
\clearpairofpagestyles
\ohead{Analizy~Wytrzymalosciowe}
\ihead{Zadania i rozwiazania}
\cfoot*{\headmark}
\ofoot{str.~\thepage}
\pagestyle{scrheadings}% needed, because the default for article is plain
\begin{document}
\tableofcontents
\newpage\section{rozdzial pierwszy}
\newpage\subsection{podrozdzial pierwszy}
\newpage\section{rozdzial drugi}
\newpage\subsection{podrozdzial jeden}
\newpage\section{rozdzial trzeci}
\newpage\subsection{podrozdzial o pierwszym numerze}
\end{document}
As you have used
scrextend already, you are not far away from using a KOMA-Script class, because package scrextend was made to bring at least some of the KOMA-Script extensions to the standard classes.
BTW:
scrlayer-scrpage can also be used with the standard classes:
\documentclass[12pt]{article}
\usepackage[table,xcdraw]{xcolor}
\usepackage{listings}
\usepackage{inputenc}% inputenc without option makes not sense with LaTeX from 2018/04/01
\usepackage{graphicx}
\usepackage{polski}
\usepackage[foot=1.25cm,head=\baselineskip, headheight=12pt, marginparsep=2mm ]{geometry}
\usepackage{textcomp}
\usepackage{gensymb}
\usepackage{parskip}
\usepackage{multirow}
\usepackage{tabularx}
\usepackage{enumitem}
\usepackage{booktabs,arydshln}
%\usepackage{array}% Useless, because already loaded by tabularx
\usepackage{caption}
\usepackage{amsmath}
\usepackage{scrextend}
\usepackage{mwe}
\usepackage[export]{adjustbox}
\usepackage{setspace}
\usepackage{stanli}
\usepackage{tikz}
\usepackage{wrapfig}
% Using scrlayer-scrpage instead of fancyhdr.
\usepackage[automark,headsepline=2pt,footsepline=1pt]{scrlayer-scrpage}
\renewcommand*{\sectionmarkformat}{\thesection.\enskip}
\clearpairofpagestyles
\ohead{Analizy~Wytrzymalosciowe}
\ihead{Zadania i rozwiazania}
\cfoot*{\headmark}
\ofoot{str.~\thepage}
\setkomafont{pageheadfoot}{\normalfont}
\begin{document}
\tableofcontents
\newpage\section{rozdzial pierwszy}
\newpage\subsection{podrozdzial pierwszy}
\newpage\section{rozdzial drugi}
\newpage\subsection{podrozdzial jeden}
\newpage\section{rozdzial trzeci}
\newpage\subsection{podrozdzial o pierwszym numerze}
\end{document}
As you can see, it is almost the same as with a KOMA-Script class.
