Store eight bits on a punched card
JavaScript (ES6),  103  100 bytes
See also my other answer for less bitwise operations, more maths, and a closed-form expression
Both functions expect and return an integer.
8-bit → 12-bit ( 56  53 bytes)

f=n=&gt;n&amp;&amp;(w=f(n-1),w+=(x=w&amp;w-1)&amp;x-1?w-x:1)+(w&amp;w/2&amp;w/4)

Try it online!
How?
This is a recursive function that computes the next valid 12-bit word \$w_{n+1}\$ directly from the previous valid word \$w_n\$.
Step 1: Update w according to the total number of bits set
Given w from the previous iteration we first compute:
x = w &amp; (w - 1)

which is w without its least significant bit.
Likewise, we remove the least significant bit from x by doing:
x &amp; (x - 1)

If the result is zero, we just increment w.
If the result is non-zero, it means that there are already 3 bits set in w and we are not allowed to insert a 4th one. In that case, we add the least significant bit of w (which is w - x) to w. This results in at most as many bits set in the updated value than in the original one, or less in case of carry propagation.
Examples:
110010 +  10 -&gt; 110100
101100 + 100 -&gt; 110000

Step 2: Update w according to the number of consecutive bits set
We now have to make sure that there are not 3 consecutive bits set in w. We do that by adding the result of a bitwise AND between w, w / 2 and w / 4.
Example:
01110 + (01110 &amp; 00111 &amp; 00011) -&gt; 01110 + 10 -&gt; 10000

12-bit → 8-bit (47 bytes)

f=w=&gt;w&amp;&amp;!(w&amp;w/2&amp;w/4|(y=(x=w&amp;--w)&amp;x-1)&amp;y-1)+f(w)

Try it online!
How?
In this version, we decrement w at each iteration and increment the final result whenever w is a valid 12-bit word. We stop when w = 0.
We use the following methods to test the validity of w. They are similar to the ones used above.

we compute w &amp; w / 2 &amp; w / 4 to make sure that there are not 3 consecutive bits set
we compute a chain of three w &amp; (w - 1) to make sure that there are no more than 3 bits set