I heard in a lecture that the scholars permitted wiping over socks through which the skin cannot be seen, but I have read that it is permissible to wipe over socks even if they are thin. Which of the two opinions is more correct?

Praise be to Allah

Firstly

It is established in the Prophet’s Sunnah that one may wipe
over the khuffayn (a kind of leather slipper that covers the ankle).

The majority of scholars include socks under this ruling.

What is meant by socks, as was stated by al-Khaleel al-Faraaheedi,
is a covering for the feet. See: al-‘Ayn (6/113).

In Mawaahib al-Jaleel (1/318) it says: Socks are a
kind of footwear in the shape of the khuff, made of linen, cotton or other
fabric. End quote.

The difference between socks and khuffaayn is that the
khuffaayn are made of leather, whereas socks are not made of leather; rather
they are made of wool, linen, cotton or other fabrics.

At the present time, socks are also made of nylon (or
synthetic fabrics).

Secondly:

There is no saheeh report from the Prophet (blessings and
peace of Allah be upon him) about wiping over socks.

With regard to the hadith narrated by at-Tirmidhi (99) via
Abu Qays from Huzayl ibn Shurahbeel from al-Mugheerah ibn Shu‘bah, who said:
The Prophet (blessings and peace of Allah be upon him) did wudoo’ and wiped
over his socks and sandals – it is a da‘eef (weak) and shaadhdh (odd) hadith.

Abu Dawood said in as-Sunan (159):

‘Abd ar-Rahmaan ibn Mahdi did not narrate this hadith,
because what is well known from al-Mugheerah is that the Prophet (blessings
and peace of Allah be upon him) wiped over the khuffayn. End quote.

‘Ali ibn al-Madeeni said: The hadith of al-Mugheerah ibn
Shu‘bah (about wiping over the khuffayn) was narrated from al-Mugheerah by
the people of Madinah, the people of Kufah, and the people of Basra. It was
narrated by Huzayl ibn Shurahbeel from al-Mugheerah, but he said: And he
wiped over his socks – and he (Huzayl) differed from other narrators.

End quote from as-Sunan al-Kubra by al-Bayhaqi
(1/284)         

Al-Mufaddal ibn Ghassaan said: I asked Yahya ibn Ma‘een about
this hadith and he said: All the narrators narrated it in reference to the
khuffayn, apart from Abu Qays.

End quote from as-Sunan al-Kubra by al-Bayhaqi
(1/284) 

Among those who also classed it as da‘eef were Sufyaan
ath-Thawri, Imam Ahmad, Ibn Ma‘een, Muslim, an-Nasaa’i, al-‘Uqayli, ad-Daaraqutni
and al-Bayhaqi. 

An-Nawawi said: These are the leading scholars of hadith.
Although at-Tirmidhi said it was a hasan hadith, these scholars take
precedence over him; in fact if any one of them was the only one to hold
that view, he would still take precedence over at-Tirmidhi, according to the
consensus of the people of knowledge.

End quote from al-Majmoo‘ Sharh al-Muhadhdhab (1/500).

But there are saheeh reports about wiping over the socks from
the Sahaabah. 

Ibn al-Mundhir said:

The permissibility of wiping over the socks was narrated from
nine of the Companions of the Messenger of Allah (blessings and peace of
Allah be upon him: ‘Ali ibn Abi Taalib, ‘Ammaar ibn Yaasir, Abu Mas‘ood,
Anas ibn Maalik, Ibn ‘Umar, al-Bara’ ibn ‘Aazib, Bilaal, Abu Umaamah and
Sahl ibn Sa‘d.

End quote from al-Awsat (1/462)

Ibn al-Qayyim said: Abu Dawood added Abu Umaamah, ‘Amr ibn
Hurayth, ‘Umar and Ibn ‘Abbaas. Thus there were thirteen Sahaabah (who held
this view).

So the view that it is permissible is based on these Sahaabah
(may Allah be pleased with them), not the hadith of Abu Qays.

Ahmad stated that it is permissible to wipe over the socks,
and he said that the report of Ibn Qays was flawed.

That stems from his fair-mindedness and justice, may Allah
have mercy on him. Rather he based it on the view of these Sahaabah, and
clear analogy, because there is no clear difference between socks and
khuffayn that would make the ruling different.

End quote from Tahdheeb as-Sunan (1/187)

Ibn Qudaamah said: The Sahaabah (may Allah be pleased with
them) wiped over the socks, and there was no one who disagreed with them
during their own time, therefore it is consensus.

End quote from al-Mughni (1/215)

Similarly, there is no difference between the khuffayn and
sock, if you think about it.

Shaykh al-Islam [Ibn Taymiyah] said:

The difference between socks and khuffayn is that the former
are made of wool and the latter are made of leather.

It is known that such differences do not have any impact on
shar‘i rulings. It makes no difference whether it is made of leather,
cotton, linen or wool.

By the same token, it makes no difference whether garments
worn in ihram are black or white. … The most that can be said is that
leather is longer lasting than wool, but this does not affect the ruling,
just as it is not affected if the leather is durable.

Moreover, it is well-known that the need to wipe over one is
the same as the need to wipe over the other. As they are same in terms of
the reason and need for wiping, differentiating between them would be
differentiating between two similar things, which is contrary to the
fairness and common sense that are promoted by the Qur’an and Sunnah, and
that with which Allah sent down His Books and sent His Messengers.

Those who differentiate between them on the grounds that one
is permeable  and the other is not has mentioned a difference that does not
affect anything.

End quote from Majmoo‘ al-Fataawa (21/214)

Thirdly:

The majority of those scholars who regard it is permissible
to wipe over the socks stipulated that in order for it to be permissible to
wipe over them, they should be thick and it should be possible to walk in
them. See: al-Mabsoot (1/102); al-Majmoo‘ (1/483); al-Insaaf
(1/170)

That is because the ruling on socks is the same as the ruling
on khuffayn, and the khuffayn can only be thick, so socks cannot take the
place of khuffayn unless they are like them.

Al-Kaasaani said: If (the socks) are thin and let water
through, then it is not permissible to wipe over them, according to
scholarly consensus.

End quote from Badaa’i‘ as-Sanaa’i‘ (1/10)

Ibn al-Qattaan al-Faasi said: All scholars are unanimously
agreed that if the socks are not thick, it is not permissible to wipe over
them.

End quote from al-Iqnaa‘ fi Masaa’il al-Ijmaa‘ (no.
351)

Shaykh al-Islam [Ibn Taymiyah} was asked: Is it permissible
to wipe over socks, like the khuff, or not?

He said: Yes, it is permissible to wipe over the socks if one
can walk in them, whether they are made of leather or not.

End quote from Majmoo‘ al-Fataawa (21/213)

And he said: If they are thin, they cannot be wiped over,
because usually one cannot walk in such socks and there is no need to wipe
over them.

End quote from Sharh ‘Umdat al-Fiqh (1/251)

In Fataawa al-Lajnah ad-Daa’imah (5/267) it says: The
socks must be thick, and what is beneath them should not be visible. End
quote.

And they said: It is permissible to wipe over anything that
covers the feet and is worn on them, such as khuffayn and thick socks.

End quote from Fataawa al-Lajnah ad-Daa’imah (4/101)

Similarly, Shaykh Muhammad ibn Ibraaheem said: It is
permissible to wipe over socks and the like, whether they are made of wool,
camel hair, goat hair, cotton or other materials, if they are thick and
cover the place that it is obligatory to wash, and they fulfil all the
necessary conditions.

End quote from Fataawa wa Rasaa’il ash-Shaykh Muhammad ibn
Ibraaheem
(2/66)

And he said: But if the sock is thin and shows the skin, then
it cannot be wiped over.

End quote from Fataawa ash-Shaykh Muhammad ibn Ibraaheem
(2/68)

Shaykh Ibn Baaz said: One of the conditions (for it to be
permissible (to wipe over the socks) is that the socks should be thick and
covering. If they are thin, it is not permissible to wipe over them, because
in that case the foot is as if it is uncovered.

End quote from Fataawa ash-Shaykh Ibn Baaz (10/110)

Some of the scholars regarded it as permissible to wipe over
the socks in all cases. 

An-Nawawi said: Our companions narrated from ‘Umar and ‘Ali
(may Allah be pleased with them) that it is permissible to wipe over the
socks, even if they are thin. They also narrated that from Abu Yoosuf,
Muhammad, Ishaaq and Dawood.

End quote from al-Majmoo‘ Sharh al-Muhadhdhab (1/500)

This is the view that was regarded as more likely to be
correct by Shaykh al-Albaani and Shaykh Ibn ‘Uthaymeen (may Allah have mercy
on them)

But what we have mentioned above is the view of the majority
of scholars, and it is the more correct view, because the basis for
regarding it as permissible is an analogy with the khuffayn, and thin socks
are not like the khuffayn, so no analogy can be made with them.

The socks that the Sahaabah used to wipe over were thick,
because thin socks were not known until recently.

Imam Ahmad said: It is not acceptable to wipe over the socks
unless they are thick socks. … The people only used to wipe over socks
because for them they were equivalent to the khuffayn, so they took the
place of the khuffayn on a man’s feet, and a man used to come and go wearing
them.

End quote from al-Mughni by Ibn Qudaamah (1/216)

If it is asked: why did the scholars stipulate these
conditions with regard to socks?

Al-Mubaarakfoori said: The basic rule is that the feet are to
be washed, as is the apparent meaning of the Qur’an, and turning to
alternatives is not permissible except on the basis of saheeh hadiths, the
soundness of which is agreed upon among the leading scholars of hadith, such
as the hadiths which speak of wiping over the khuffayn. So it is permissible
to turn from washing the feet to wiping over the khuffayn, and there is no
difference of scholarly opinion on that point.

But with regard to the hadiths which speak of wiping over the
socks, there is some difference of opinion among the leading scholars in the
field concerning their soundness. So how can it be permissible to turn from
washing the feet to wiping over the socks in all cases?

Because of that, they stipulated these restrictions on the
permissibility of wiping over the socks, so that the socks in question would
come under the same heading as the khuffayn and thus be included in the
hadiths that speak of the khuffayn.

If the socks are thick and can be kept on the feet without
being tied, and it is possible to walk in them, then undoubtedly there is no
significant difference between this type of socks and the khuffayn, because
they are like the khuffayn. But if they are thin and cannot be kept on the
feet without being tied, and it is not possible to walk far in them, then
they are not like the khuffayn, and undoubtedly there is a significant
difference between them and the khuffayn.

Do you not see that the khuffayn are like sandals, and if
sandals are not available, a man can come and go wearing the khuffayn, and
walk wherever he wants? So wearing the khuffayn does not require him to take
them off when walking, so he does not have to take them off by day or by
night; rather he can wear them for several days and nights, and it would be
difficult for him to take them off every time he does wudoo’.

In contrast, for the one who wears thin socks, every time he
wants to walk he has to take them off several times during the day and
night, and in this case it is not difficult for him to take them off every
time he does wudoo’. This difference dictates that the concession should be
granted to the one who wears khuffayn but not to the one who wears thin
socks. Making an analogy in this case would be making an analogy despite the
difference.

End quote from Tuhfat al-Ahwadhi (1/285)

Conclusion:

The view of the majority of scholars is that it is not
allowed to wipe over thin socks, and that the permissibility (of wiping over
socks) is limited to thick socks.

And Allah knows best.