Let me start by saying I agree with what both @Barbaud Julien and @Chester Miller said. So my answer is only intended to provide a different perspective.
First, it is true that the entropy is a state function of a system, and therefore the change of entropy of the system between any two given equilibrium states will be the same whether or not the process between the states is reversible. However, the change in entropy of the system plus surroundings will depend on the process. It will be zero if the process is reversible, and greater than zero if irreversible.
Consider a cycle consisting of two isothermal and two adiabatic processes. If the processes were all reversible, we would obviously have a Carnot cycle. Since your question focuses on the effect of heat transfer on entropy, let’s assume the adiabatic processes are reversible adiabatic (isentropic) and consider only the impact of the heat transfer processes being reversible or irreversible.
Let’s take the example of a heat addition expansion process of an ideal gas between two equilibrium states. Let the initial and final temperatures be equal. Consequently, from the ideal gas law, the initial and final pressure-volume products are equal. Clearly the process between the states may be a reversible isothermal process. However, it also need not be. We’ll consider both.
Let the temperature of the system be $T_{sys}$ and the temperature of the surroundings be $T_{sys}+dT$. Consider the system and surroundings as thermal reservoirs, i.e., heat transfer between them does not alter their temperatures so that the heat transfer occurs isothermally.
Let a specific quantity of heat, $Q$, transfer from the surroundings to the system. The resulting entropy changes are:
$$\Delta S_{sys}=\frac{+Q}{T_{sys}}$$
$$\Delta S_{surr}=\frac{-Q}{T_{sys}+dT}$$
The net change in entropy (system + surroundings) is thus:
$$\Delta S_{net}=\frac{+Q}{T_{sys}}+\frac{-Q}{T_{sys}+dT}$$
Now, note that if $dT\to 0$, then $\Delta S_{net}\to 0$ and the process is a reversible isothermal process.
However, for any finite temperature difference, $dT>0$, $\Delta S_{net}>0$ and the process is irreversible.
For both the reversible and irreversible processes, the change in entropy of the system is the same. However, for the irreversible process the change in entropy of the system is greater than the change in entropy of the surroundings. The excess entropy that is created in the irreversible expansion process means more heat must be rejected to the cold temperature reservoir (surroundings) during the isothermal compression in order for the cycle entropy to be zero. That results in less energy to do work in the cycle.
Although in this example the same amount of heat is transferred reversibly and irreversibly, clearly the rate of heat transfer will be greater for the irreversible than the reversible process owing to the finite temperature differential for the irreversible process. So for the amount of heat transfer to be the same, the product of the very slow heat transfer rate times the very long time for the reversible process would need to equal the product of the higher heat transfer rate times the shorter time duration for the irreversible process.
Hope this helps.
Best Answer
Entropy $S$ is a state function.
It only depends on the final and initial states, and not on how the state was reached.
The Clausius' Inequality states
$$\oint \frac{đQ_\textrm{system}}{T_\textrm{source}}\leqq 0\,.\tag{I }$$
When the cycle is reversible, $T_\textrm{source}~=~ T_\textrm{system}$ and equality of $\rm(I)$ applies i.e.,
$$\oint \frac{đQ_\textrm{system}}{T_\textrm{system}} = 0\tag{I.i}$$
It is a matter of few steps from $\rm(I.i)$ to show that the integral $\displaystyle\int \dfrac{đQ}{T}$ takes the same value for two different reversible paths.
So, we can define $S(\rm A) = \displaystyle\int_{\rm O_\textrm{reference state}}^{\rm A}~ \dfrac{đQ_\textrm{rev}}{T_\textrm{system}}$ i.e., for a reversible transformation.
Now, consider two paths equilibrium states $\rm A$ and $\rm B$ such that $\mathsf I$ connecting $\rm A$and $\rm B$ is arbitrary path (reversible or irreversible) and the second path $\mathsf I^\prime$ connecting $\rm B$ and $\rm A$ is reversible.
So, using $\rm(I),$ we get
$$\begin{align} \oint_{\mathrm A \mathsf I \mathrm B \mathsf{^\prime}\mathrm A } \frac{đQ}{T} & \leqq 0 \\ \implies~~~~~~~~~~~~~~~ \left (\int_{\mathrm A}^{\mathrm B} \frac{đQ}{T}\right)_{\mathsf{I}} + \left (\int_{\mathrm B}^{\mathrm A} \frac{đQ}{T}\right)_{\mathsf{I^\prime}} & \leqq 0\\\implies \left (\int_{\mathrm A}^{\mathrm B} \frac{đQ}{T}\right)_{\mathsf{I}} - \left[\int_{\mathrm O}^{\mathrm B}\frac{đQ}{T}-\int_{\mathrm O}^{\mathrm A} \frac{đQ}{T}\right]&\leqq 0~~~~~~~~~~~~~~~~~~~~~(\mathsf I^\prime~\textrm{is reversible})\\ \implies~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ S(\mathrm B)- S(\mathrm A)&\geqq \left (\int_{\mathrm A}^{\mathrm B} \frac{đQ}{T}\right)_{\mathsf{I}}\tag{II}\end{align}$$
From $\rm (II)$
$$S(\mathrm B)-S(\mathrm A)~=~\left (\int_{\mathrm A}^{\mathrm B} \frac{đQ}{T}\right)_{\mathsf{I}}~~~\textrm{iff}~~~\mathsf I ~\textrm{is a reversible transformation}$$ that is, $$S(\mathrm B)-S(\mathrm A)~=~\int_{\mathrm A}^{\mathrm B} \frac{đQ_\textrm{rev}}{T}\tag{III.i}$$
When $\sf{ I}$ is irreversible, then from $\rm{(II)}$
$$S(\mathrm B)-S(\mathrm A)\gt \int_{\mathrm A}^{\mathrm B} \frac{đQ_\textrm{irrev}}{T}$$
More precisely, using the first law $$\mathrm dS= \dfrac{\textrm{đ} q_\textrm{irrev}}{T}+ \dfrac{\left [ \textrm{đ} w_\textrm{rev}-\textrm{đ} w_\textrm{irrev}\right]}{T}\;.\tag{III.ii}$$
Both $\rm{(III.i)}$ and $\rm{(III.ii)}$ would yield the same entropy change as after-all entropy $S$ is a state function.
But which of $\rm{(III.i)}$ and $\rm{(III.ii)}$ would one use to compute the change in entropy?
Think.
References:
$\bullet$ Thermodynamics by Enrico Fermi.