In addition to Walter's spot on answer about the combined use of extensions and delimiting them by a dot and John's about the CTSS (*1) as origin for user defined types, it might be worth to note that the concept grew out of more humble beginnings. It also was (and in some cases still is) different from what the question assumes.
[Who invented] file extensions in file names?
Historical file name extensions are not in a file name - considering 'in' as part of the file name - but a separate attribute to a file - much like date created or owner.
Do we know when and where the idea of adding a suffix to filenames was conceived?
Please see Walter's answer for the direct ancestor of the modern file type and handling.
I am curious about when the need for separating files by type arose
The beginning may even predate nearly all of what we would nowadays call OSes, and originates with the first usable machine-controlled (*2) mass storage, aka Tape Drives. Here headers helped to describe the way records are accessed within a file, most notably fixed length vs. variable length vs block access.
That way, a user program could read records from tape the same way independent of format (*3). With disks more complex types were introduced, like QSAM, ISAM, VSAM, etc., those types were coded in dedicated fields and accessed by commands or command parameters separate from the file name.
Most notable here is that this type scheme grew bottom up, out of necessity to support certain FS services - like the mentioned record access - and strictly limited to what the OS/FS could understand.
In contrast, the second file name of the CTSS was developed in a top down fashion to provide a general purpose field, not intended for (primary) OS interpretation for structure but marking purpose for applications to handle them.
Follow-up systems to that went two ways, either going
the DEC way (*4) of using two dedicated fields of Name and Type with the latter being handled as part of the file name delimited by a dot. Or they followed
the UNIX way (*4) of dropping that extension field, handling only a single name field with no further structure.
The DEC way led to CP/M and in turn MS-DOS. Here all user interaction was shaped to make the dedicated field look as if it was part of the name field, thus the general impression of an extension being part of the name. While those later extending the Name part to 8 chars (DEC was originally 6), the extension was kept as 3 characters, creating the well known 8+3 structure excluding the dot.
The dot was never stored on media or in (FS) data structures. It's only a delimiter for input parsing and added on output for symmetry/convenience. Likewise the name part is always 8 characters and filled up with spaces.
An interesting variant of the DEC way is the Macintosh MFS and follow up HFS as it manages not one but two file 'types', four bytes each. One noting the creator and one for the type, but none of them directly visible to the user.
who got the idea to put that information in the names of the files.
Strictly that only happened with systems based on a flat file concept - most notable the UNIX-FS - that is, systems that do not support different file types as part of the file system. In those systems a File is just a blob of data. Giving it any descriptive meaning is up to applications (*5). Any file extension used is not a dedicated file type in its own right, but a naming convention to structure a single file name including the dot.
Bottom line, even a simple looking question like this can have a very complex background :))
*1 - Both are worth an upvote.
*2 - "Machine-controlled" meaning read and/or written with full positioning control (rewind/reposition) on the same media.
*3 - Much as were stacks of punched cards. In fact, exactly the same way as device assignment to program input has always been an operator/OS task. Most (not too complex) mainframe programs do not handle filenames at all but read from and write to standard handles. A bit like with Unix, except that there is more than one standard handle available for each.
*4 - Names used as generic indicators of heritage, not necessary inventor.
*5 - Or other dedicated fields, like the executable flag in unixoid FSes.