According to Wikipedia, each subshell can contain up to 4ℓ + 2 electrons, where ℓ stands for the azimuthal quantum number, characteristic for each subshell. Purdue University states that the value of ℓ is 0, 1, 2, 3 and 4 for subshells s, p, d, f and theoretical g.
According to Armstrong Atlantic State University, subshell s can hold up to two electrons, subshell p can contain six electrons at most, subshell d can be occupied by up to 10 electrons and subshell f can contain up to 14 electrons. In theory, subshell g could contain up to 18 electrons. However, no element with an O shell and a g subshell has been discovered as of 2014.