New answer
Denote $E(d, k)$ be the expected gain of optimal actions given d remaining days and a knowledge that the limit is at least $k$. In particular, once we know that $k$ is safe, there is no reason to pick any number below $k$. Additionally, looting $20 \geq l \geq k$ guffins should have a $\frac{20-l}{20-k}$ chance of success, resulting in an expectation of $l+\frac{20-l}{20-k}E(d-1,l)$. Hence $E(d,k)$ is the maximum of these choices, and we therefore wish to compute $E(20, 0)$.
I wrote a program to compute the optimal strategy and it attains $110$ guffins on expectation. It does so by taking $10$ guffins on the first night, which succeeds exactly half of the time (if your secret number is at least 11). Then it keeps taking $10$ guffins on all subsequent nights except the last, where it takes $20$ guffins, in which its total loot becomes $210$ guffins.
Strategy table (row = # of days remaining, column = highest known safe number)
[{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}],
[{20}, {20}, {20}, {20}, {20}, {20}, {20}, {20}, {20}, {20}, {20}, {20}, {20}, {20}, {20}, {20}, {20}, {20}, {20}, {20}, {}],
[{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {9, 10}, {9}, {8, 9}, {8}, {8, 7}, {7}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {10}, {9}, {9}, {9}, {9}, {9}, {8}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {10}, {10}, {9, 10}, {9}, {9}, {9}, {9}, {9}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {10}, {10}, {10}, {9, 10}, {9}, {9}, {9}, {9}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {10}, {10}, {10}, {10}, {9, 10}, {9}, {9}, {9}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {10}, {10}, {10}, {10}, {10}, {9, 10}, {9}, {9}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {9}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {9, 10}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {}],
[{10}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}]]
Old answer, which assumed that the guffin limit was not fixed.
If you only had one day to work, clearly the best strategy is to steal the maximum number of 20 guffins since you would be fired anyway.
Now, what if you had two days to work? If you stole $k$ guffins, you will be fired with $k/20$ probability, and in the other $1-k/20$ chance, you would be able to steal 20 guffins tomorrow, so your expected value is $k+20(1-k/20)=20$. Oh, I guess it doesn't matter at all what $k$ you pick - your expected value remains at 20 guffins. This can be repeated inductively to conclude that you can't do better than taking 20 guffins and running. Or if you value the job more than, say, a different job, then you should wait until the very last day and taking the 20 guffins. Or if there's any chance of being rehired, try to do that quickly enough so that you can take your 20 guffins again. The sky's the limit! Or rather, 20 guffins is the limit.